This topic is locked

Show list from EVENTS

3/21/2011 7:22:48 AM
PHPRunner General questions
D
Dingoboy author

I have a little news bar that is working fine,

But now i want another page showing all the records

but repeat whats inside my "echo" so i have the same design all records.
It should show all the records based on the Table Active = Active so it only show the active news

and i need it to not show records where the Date in Table End_date is earlier than today
I have try many things but think i need some help, as i am just starting to learn using events :-)

Here is the code i am using now to show the news bar:
global $dal;

$sql = "select
from news ORDER by Date";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);
{
echo '<div class="art-post">',

'<div class="art-post-tl"></div>',

'<div class="art-post-tr"></div>',

'<div class="art-post-bl"></div>',

'<div class="art-post-br"></div>',

'<div class="art-post-tc"></div>',

'<div class="art-post-bc"></div>',

'<div class="art-post-cl"></div>',

'<div class="art-post-cr"></div>',

'<div class="art-post-cc"></div>',

'<div class="art-post-body">',

'<div class="art-post-inner art-article">',

'<h2 class="art-postheader"><a href="test.php">'.$data["header"].'</a></h2>',

'<div class="art-postmetadataheader">',

'<div class="art-postheadericons art-metadata-icons">

<img src="./images/postdateicon.png" width="18" height="18" alt="" /> '.$data["Date"].'" |

<img src="./images/postauthoricon.png" width="18" height="18" alt="" /> Author

<a href="./#" title="Posts by Admin">Admin</a></div>',

'</div>',

'<div class="art-postcontent"><A href="B_photo_list.php?='.$data["Id"].'">

<img width="262" height="174" alt="" src="../2010/files/'.$data["photo"].'" style="float: left; " /></A>',

'<p>'.$data["Text"].'</p>',

'<p></p>',
'</div>',

'<div class="cleared"></div>',

'</div>',

'<div class="cleared"></div>',

'</div>',

'</div>' ;

}

Sergey Kornilov admin 3/21/2011

I would recommend to check sample code at http://xlinesoft.com/phprunner/docs/show_list_of_customer_orders.htm. It can help you get started.

D
Dingoboy author 3/21/2011



I would recommend to check sample code at http://xlinesoft.com/phprunner/docs/show_list_of_customer_orders.htm. It can help you get started.


I could not see anything from the link, but i found out that you have a '.' at the end of the link, so it send me to the wrong page. :-)

And yes i have already tried that from the manual, but with no luck :-(
by the way, i was confused about line 3 when i was playing around with it.

It say edtidi1 and not editid1 is that right ?
global $dal;

$tblOrders = $dal->Table("Orders");

$rs = $tblOrders->Query("OrderID=".$_REQUEST["edtidi1"],"");

$data = db_fetch_array($rs);

$CustomerID = $data["CustomerID"];

echo "Orders placed by " .$CustomerID. "
";

$rsOrders = $tblOrders->Query("customerid='".$CustomerID."'","");

while($data=db_fetch_array($rsOrders))

{

echo "<a target=_blank href=Orders_edit.php?editid1=".$data["OrderID"].

">". $data["OrderID"]."</a> ".$data["OrderDate"]."
";

}
I also own the hold packages of templates as well, so if you can point to some Events from there,

where i can look at the code and maybe understand better :-)

Sergey Kornilov admin 3/21/2011

You are correct, you need to use $_REQUEST["editdi1"], we'll fix that article.
Not sure what kind of trouble you having with this sample code. Could you be more specific?

D
Dingoboy author 3/21/2011



You are correct, you need to use $_REQUEST["edtidi1"], we'll fix that article.
Not sure what kind of trouble you having with this sample code. Could you be more specific?


When i using it, it comes out with a "php error happened"
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

select * from news where OrderID=
Its like its not doing the .$_REQUEST
that was why i posted my code before, in hope of getting in the right directions :-)

Sergey Kornilov admin 3/22/2011

You original code didn't make much sense - that's why I recommended to check the sample code in the manual.
If you have a valid support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.