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

Link to comment
Share on other sites

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);

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.