Can a variable being use twise?
| From: | Jack | Date: | Wed, 14 May 2003 04:21:07 +0000 |
| Subject: | Can a variable being use twise? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147542@lists.php.net to get a copy of this message | ||
Dear all
First of all, please have a look on my source code :
<?
while ($row=mysql_fetch_object($select_temp_date))
{
print $row->sign_date;
$create_joindatauser_query=mysql_query("create temporary table data_user
select temp_control_form.name as signed,temp_control_form.sign_date
,temp_signoff_user.name as name temp_signoff_user.department as dept from
temp_signoff_user left join temp_control_form on
temp_signoff_user.name=temp_control_form.name",$link);
$sql=mysql_query("select * from data_user where
sign_date='$row->sign_date'");
<<<<<<<<<<<<<<<<<<<<
while($row1=mysql_fetch_object($sql))
{
$sql_temp=mysql_query("delete from data_user where
name='$row1->signed'");
}
$sql2=mysql_query("select * from data_user order by name");
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
while($row2=mysql_fetch_object($sql2))
{
print ("<TR>\n");
print ("<TD><font face='Arial, Helvetica, sans-serif'
size='1'>".$row2->name."</font></TD><TD><font
face='Arial, Helvetica,
sans-serif'
size='1'>".$row->sign_date."</font></TD>");
print ("</TR>\n");
}
$drop_datauser_query=mysql_query("drop table data_user");
}
?>
When i run this code, it says there is an error on line where i marked
"<<<<<" on it.
To what i understand is $sql and $sql2 is being used twise, for the first
time it is fine, but when comes to the second time, it look like it can't
get through!
Can anyone pls tell me is there possible way that a variable can be assign
twise when running a loop condition?
Thx alot!
Jack