fixed!
fixed!
Last edited by Demonicman; 10-25-2007 at 04:51 AM.
http://www.insanecombat.com << bored? check out ma game
The problem may lie here: $User[ID]
That syntax doesn't look right, as in double quotes only simple variables are parsed, and ID would be a constant there, which has not been defined; however, 'ID' would be a valid index in the array. (ID, by itself, is a constant, like $ID, but having been set with define().)
In the end, the error itself is because the query returned no results.
Embedding mysql_fetch_array(mysql_query($query)) all in one makes troubleshooting and error compensation tough; separate them to make things easier.
$query = 'stuff here'; //then you can echo it to check
$result = mysql_query($query); //now you can use $result
//you could use mysql_num_rows to see if there was any match
THEN, $row = mysql_fetch_array($result);
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
wow, i appreciate your help, thx
Last edited by Demonicman; 10-25-2007 at 04:50 AM.
http://www.insanecombat.com << bored? check out ma game
Nvm Fixed
Last edited by Demonicman; 10-25-2007 at 04:50 AM.
http://www.insanecombat.com << bored? check out ma game
I'm not sure what's confusing.
ID by itself would be a constant, which is similar to a variable in PHP but simply stores a constant value. Just like "3" represents the numerical value of 3, ID could represent a set numerical value of "5", if set as such. (Though it can store any type of data, not just numbers.)
The difference between a constant and a variable is that a variable is easily accessible and changed; a constant is set once with the define() function.
So... the point... you AREN'T using this, especially if you don't understand it.
You want to use an index, which is a name for a part of an array.
$array[a] would be using the constant a, and that's just not what you want.
$array['a'] would give the 'a' element of the array.
As for splitting it up, that should be self explanatory. As per the comments above, error check to see where the problem lies. Is it the query? Does it return rows (checked with mysql_num_rows)?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
It would be preferable to leave the question there for future readers.It should be noted that undefined constants are automatically interpreted as strings (here, for example, $array[a] is interpreted as $array['a']). However, relying on this is a bad idea, since if someone does define a constant 'a' it will muck everything up (and it's deprecated, and will throw a warning).$array[a] would be using the constant a, and that's just not what you want.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Removing the question is quite annoying. It's important to leave this as a resource for others who have the same question so they can search and so we can link to this as a solution.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks