Jump to content


Check out our Community Blogs

robertpeter07

Member Since 16 Oct 2012
Offline Last Active Oct 16 2012 05:34 PM
-----

Topics I've Started

does variable needed in querying from mysql?

16 October 2012 - 04:33 PM

hi guys! I want to ask why do you have to use a variable to query from mysql?
what makes this difference from the above example?
<?php
$query = "SELECT * FROM Person";
mysql_query($query);
?>

querying using mysql_query function:
<?php
mysql_query("SELECT * FROM Person");
?>

could someone explain me the difference and why use the first sample instead of second sample or vice versa?

Peter

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download