Can some one tell me what's wrong with the following mysql_query?
mysql_query("select $move from moves where game_num = '$ID' && color = 'blue'", $db);
The error returned by mysql_error() is
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version...
How would one get the first character of a string, regardless of what it is? I've looked through the PHP manual briefly and nothing looked obvious.
ex. $string = "somestring";
$string = somefunction($string); // returns "s
I suppose I'll just have to update the row clearing all the entries (besides the keys). I'm designing an online game and I want to clear a move list after the script is done processing the data for that round.
nevermind again :). I was looking for help in the mysql forum and as I was explaining that all the variables were set I got to thinking...maybe they're not. Turns out I forgot to pass a session ID in the query string
assuming all variables are set and $db is a valid link resource and mysql_error() returns nothing and the table exists with the specified column names, what is wrong with the following statement?
$piece_update = mysql_query("UPDATE `moves` SET `$move_from` = '$moves[$foo]', `$move_to` =...
those functions should still be there. I'm writing code right now that's using those and it works fine (I have the same version of PHP). You might check your php.ini settings...
can someone look at this function and tell me what's wrong? I'm getting the following error:
Parse error: parse error, unexpected T_VARIABLE in (file name) on line 13
function store_data($db, $ID, $color, $moves)
{
for($i = 1, $foo = 0; $i <= 12; $i++, $foo += 2)
{
$foo2 = $foo + 1...
I can't find a probem in the following mysql_query, though it is working fine. All the variables are set and contain correct data but the table is not being altered.
mysql_query("UPDATE `moves` SET `$move_from` = '$moves[$foo]', `$move_to` = '$moves[$foo2]' WHERE `ID` = '$ID' && `color` =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.