RE: [PHP] Can a variable being use twise?

From: Date: Wed, 14 May 2003 08:05:44 +0000
Subject: RE: [PHP] Can a variable being use twise?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147551@lists.php.net to get a copy of this message
Jack, kinda new here to php, but your "<<<<<<.....", Im wondering if that is intended to be a comment for a line break in the code for you to reference later when changing your own code? If it is, I don't believe that's the best way to comment out your code. :) Try this - // <<<<<<<< OR This - # <<<<<<< OR Even This - /*for multilined or blocked comments just like this*/ I believe any of them would work for this situation. I checked the site, and I don't see anywhere that this "<<<<<<" is code for anything other than assigning a <<<COMMENT to a variable like the example on this page at the bottom http://www.php.net/manual/sk/language.basic-syntax.comments.php, anyhow don't get upset if this doesn't fix it and this wasn't what you where looking for, I am still learning php, just thought I'd throw in my 2cents. Best of Luck, Wolf Smart Enterprises http://www.wolfsmart.com -----Original Message----- From: Jack [mailto:nedcor4@nedcor.com.hk] Sent: Tuesday, May 13, 2003 11:21 PM To: php-general@lists.php.net Subject: [PHP] Can a variable being use twise? 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#147551) next »