[thelist] PHP/MySQL odd problem

Mr. Tenuta dtportnoy at videotron.ca
Mon Jul 12 09:32:00 CDT 2004


> I've been following this thread avidly but do not understand the solution
> as supplied by Burhan Khalid. As far as I can see Mr Tenuta's code was
> identical in the two SQL statements (apart from the table name) but Burhan
> points out that the "$link" variable was being reassigned. Can someone
> point out what I'm not seeing, please?

Ergh, sorry last e-mail sent automatcally by accident.. Here goes the good
version:

Heya,

Here's the problem. I was using this format...
mysql_query("SELECT......blahblah", $link);

Notice the variable link being used there. That $link is where i stored my
mysql_connect info. First time works fine, then i do this on the first time:

>  $link = $row["link"];

Here i am overwritting the original connection variable $link to store the
data that is in the "link" column, therefor the connection variable is no
longer existant. So on my second qeury:

mysql_query("SELECT......blahblah", $link);

there is an error because $link has changed. In lamer terms I used the same
variable to store two different things. A real amateur mistake and well
overlooked :P

Hope that clarifies it,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lawrence Tenuta @ neoDesignz
http://www.neodesignz.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the thelist mailing list