Caffeinenyx Posted May 5, 2011 Share Posted May 5, 2011 $entrantQuery = "SELECT entrantID FROM entrants WHERE Game = $idT"; $entrantResult = mysql_query(entrantQuery); $entrantRow = mysql_fetch_row(entrantResult); I have these at the start of my php (after getting $idT), but I get the error Notice: Use of undefined constant entrantQuery - assumed 'entrantQuery' in C:\Entrants.php on line .. Notice: Use of undefined constant entrantResult - assumed 'entrantResult' in C:\www\Entrants.php on line.. Ive used this code lots of times before, what am I missing? They are variables that I am defining! Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 5, 2011 Share Posted May 5, 2011 Php variable names start with $ Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/#findComment-1211087 Share on other sites More sharing options...
Drummin Posted May 5, 2011 Share Posted May 5, 2011 Looks like you're missing the dollar sign. $entrantQuery = "SELECT entrantID FROM entrants WHERE Game = $idT"; $entrantResult = mysql_query($entrantQuery); $entrantRow = mysql_fetch_row($entrantResult); EDIT-You beat me to it. Php variable names start with $ Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/#findComment-1211088 Share on other sites More sharing options...
Caffeinenyx Posted May 5, 2011 Author Share Posted May 5, 2011 No im not, its a weird font but they all start with $? $entrantQuery etc Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/#findComment-1211095 Share on other sites More sharing options...
PFMaBiSmAd Posted May 5, 2011 Share Posted May 5, 2011 A error from the php language engine and two different people, one of which posted fixed code, have pointed to your code that is missing the $ on some variables. I suggest you look at your code again. Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/#findComment-1211099 Share on other sites More sharing options...
dodgeitorelse Posted May 5, 2011 Share Posted May 5, 2011 I think they are talking bout the $ missing inside your () for variables. Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/#findComment-1211100 Share on other sites More sharing options...
Caffeinenyx Posted May 5, 2011 Author Share Posted May 5, 2011 Sorry, been coding for days to finish this - I think im going a bit insane! Im sure they had $ before.... The universe removed them! Thanks anyway for sorting my stupidity. Quote Link to comment https://forums.phpfreaks.com/topic/235632-undefined-constant/#findComment-1211106 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.