Jump to content

[SOLVED] Help using php variables, in mysql query, in a php function


spraypray12

Recommended Posts

Heres my code

 

function grabit()
{

			$mySQL_query2 = "SELECT Requestor FROM ordrfrm WHERE id LIKE" . " $id";
			echo "<pre>\n$mySQL_query2\n</pre>";
			$f = mysql_query($mySQL_query2);
			while($row = mysql_fetch_assoc($f))
{
    echo "Name :{$row['Requestor']} <br>";
    }
   }
grabit();
echo $id

 

When i take this code out of a function, it works fine and gets me the results. It's the firsts steps for a little bit bigger function i'll build later, bit i  can't get this one working. Any Suggestions?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.