Page 1 of 1

the same variables

Posted: Wed Jun 09, 2004 10:28 am
by duk
hy

if in all my pages... i have the same variable to sql querys... like this one

Code: Select all

<?php
$comando = "update test SET id='$id_clan' where id='$id_test'";

$executa_comando = mysql_query("db", $comando);


?>
in all my pages i use the var $comando...

if in the same time 3 users, in 3 diferent pages, made a query to the mysql db, i will have some problems ????

becouse will be 3 query's with the same var name...

ill need to use mysql_free_result, or this error will never exists ???

Posted: Wed Jun 09, 2004 10:36 am
by Illusionist
English?

Posted: Wed Jun 09, 2004 10:37 am
by Saethyr
You should not have problems as the variable will be unset automatically by php when that script terminates.

Posted: Wed Jun 09, 2004 10:52 am
by patrikG
Illusionist wrote:English?
Politeness and try to help?

Posted: Wed Jun 09, 2004 12:31 pm
by pickle
You shouldn't have a problem. Yes each user will have their own query named the same, but it's stored with their process. When a user accesses a page, a process for generating that page is created. All variables and the like that are created in that process, are only accessible through that process. So, the server and PHP won't get confused when multiple processes (or users) have identically named variables.

Posted: Wed Jun 09, 2004 3:22 pm
by Illusionist
patrikG wrote:
Illusionist wrote:English?
Politeness and try to help?
Help what? i couldn't tell what he was asking. Was he asking if he was going ot have problems? Or was he asking if mysql_free_results would fix the error. Well what error? And by the way hes last sentence is worded it is as if he is saying if he uses mysql_free_result onlt then will he get an error...

Posted: Wed Jun 09, 2004 3:52 pm
by patrikG
My point was more about politeness. Not everyones first language is English (heck, it's not mine for sure) and with some good will duk's post makes sense. Ambiguities can be narrowed down and, if you don't understand a post, simply ask the bits you don't understand.

As is, a simple "English?" is flippant, doesn't help with the problem and thus is unecessary to post.

Posted: Thu Jun 10, 2004 7:35 am
by magicrobotmonkey
It's not good English, either.