Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: theoneweasel77
  • Order by date
  1. theoneweasel77

    mysql_query syntax

    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...
  2. theoneweasel77

    Getting the first character of a string

    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
  3. theoneweasel77

    Clear table row

    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.
  4. theoneweasel77

    Clear table row

    Is there any quick way to clear a table row without deleting it?
  5. theoneweasel77

    mysql_query() not working

    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
  6. theoneweasel77

    mysql_query() not working

    the second code block produces an error.
  7. theoneweasel77

    mysql_query() not working

    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` =...
  8. theoneweasel77

    syntax error somewhere...

    I don't know why you need parenthesis there... that seems odd to me. oh well.
  9. theoneweasel77

    Missing functions in PHP 4.3.8

    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...
  10. theoneweasel77

    syntax error somewhere...

    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...
  11. theoneweasel77

    mysql_query error

    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` =...
  12. theoneweasel77

    Autodecrementing variables

    In case anyone wondered, there is a way around this with the chr function
  13. theoneweasel77

    Autodecrementing variables

    what is a "character variable"?
  14. theoneweasel77

    Autodecrementing variables

    that didn't work either... What is meant by "character variables"?
  15. theoneweasel77

    Autodecrementing variables

    so, if I made it a string, could I get away with it? (example $var = "foo" $var-- would give me "fon")
  16. theoneweasel77

    Autodecrementing variables

    It didn't. Output is at http://www.thespaz.net/games/board_display.php and source follows <? $var = "c"; $i = 3; print $var; print "<br>"; print $i; print "<br>"; $var--; $i--; print $var; print "<br>"; print $i; ?> If you need to see the php.ini file, it's at...
  17. theoneweasel77

    Variable names in variables

    Ok, thanks, that documentation cleared it up. {}
  18. theoneweasel77

    Autodecrementing variables

    I know that if you have a variable $var = "c", you can say $var++ and $var now equals d. Can you autodecrement $var? (I used $var-- and it didn't change the value).
  19. theoneweasel77

    Variable names in variables

    and that is function field_or_forest($pos)
  20. theoneweasel77

    Variable names in variables

    oops, sorry. Meant to include the worlds most massive if statement :) if ($pos == "a1" || $pos == "a2" || $pos == "a3" || $pos == "a4" || $pos == "b1" || $pos == "b2" || $pos == "b3" || $pos == "b4" || $pos == "b5" || $pos == "b7" || $pos == "b10" || $pos == "c1" || $pos == "c3" || $pos ==...

Part and Inventory Search

Back
Top