capone
Posts: 6
|
| Posted: 06/22/2008, 9:39 AM |
|
i upgraded from php 4 to 5.2.5 i am also using templates my script doesn't work in php 5 but idoes under php 4.
##################
$sqlL=("select * from jbase where mid =2);
$db->query($sqlL);
if($db->next_record())
{
do
{
$fldid = $db->f("job_id");
$fldtitle = $db->f("title");
$tpl->set_var("id", $fldid);
$tpl->set_var("title", tohtml($fldtitle));
$tpl->parse("JList", true);
$iCounter++;
} while($iCounter < $RecordsPerPage &&$db->next_record());
}
####################
the query works
the problem seems to be $db->f("###")- it won't populate
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 06/22/2008, 4:31 PM |
|
$sqlL='select * from jbase where mid =2';
Also, in Project Settings set target for PhP5.
Where is this code in your application?
Is it in an event? Which event?
Does the page have a record? What name?
What is the name of your Database connection?
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
capone
Posts: 6
|
| Posted: 06/24/2008, 9:12 AM |
|
i am using code from CodeCharge 1.1.19 just a standard dbase query, i isloated the problem to $db->f("job_id");
example:
$iCounter = 0;
if($db->next_record())
{
do
{
$fldid = $db->f("job_id");
$tpl->set_var("id", $fldid);
$iCounter++;
}while($iCounter < $RecordsPerPage &&$db->next_record());
}
the query works, and templates work - i just can't get the results to populate in the $fldid = $db->f("job_id"); works in php4 not in php5?
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 06/24/2008, 11:59 AM |
|
CodeCharge (The Original) ????
That did not even support this syntax.........afaik
your result set is more than 1 row
you are looping through the result always moving the retreived value into the same id.
My guess is your query and your ->f work ok but the last row retreived either has no job_id or you read one to many.
All in all, happy coding.
example:
$iCounter = 0;
if($db->next_record())
{
do
{
$fldid = $db->f("job_id");
print ( $fldid . ' ' ); // will echo the result
$tpl->set_var("id", $fldid);
$iCounter++;
}while($iCounter < $RecordsPerPage &&$db->next_record());
}
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|