Jump to content

Does defining a variable already executes it ?


Frank100

Recommended Posts

Question, is the connection done with the following $cxn already ?

Or is this just defining a variable which will be executed later in the $result ?

If just a variable definition, how would I execute $ result ?

 

$cxn = mysqli_connect($host,$user,$password,$database)

        or die ("Couldn't connect to server");

 

 

$result = mysqli_query($cxn,$query)

           or die ("Couldn't execute insert query");

 

 

Regards,

Frank

thx for the replies,

 

so when I understand right in the following sample $qry is not creating a variable because it creates a resource that immediately is executed ?

 

 

 

 

 

<?php

$qry  =mysql_query("SELECT * FROM `staff` WHERE `clue` > 0");

echo mysql_num_rows($qry);

?>

 

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.