...

View Full Version : Confused about $info or $query



tomyknoker
04-08-2007, 05:26 AM
Sorry if this is just a stupid stupid question, i notice on SQl Queries sometimes people use $info sometimes they use $query, is there a reason for this or is it pure preference?

iLLin
04-08-2007, 03:53 PM
Preference. I use this way:

$query = "query";
$result = mysql_query($query);
$row = fetch_array($result);

I can't stand this

$query2
$result2....

But If I have a function and I am returning say "user_info" Then in my function i have the query info then I put the array into that variable like so.



function get_user_info() {
$query = "Select *";
$result = mysql_query($query);
$row = mysql_fetch_array($result);

return $row;
}

$user_info = get_user_info();



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum