MySQL Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Entrophy
Forum Newbie
Posts: 4
Joined: Tue Mar 21, 2006 5:47 pm

MySQL Problem

Post by Entrophy »

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

<form name="signup" method=get>
<p>

  <table cellspacing="2" cellpadding="2" align="center">

  <td><div>Your Race:</div></td>
              <td><select name="strRACE" class="black">
                  <option value="0"> </option>
                  <option value="Human">Human</option><option value="Elf">Elf</option><option 

value="Dwarf">Dwarf</option><option value="Orc"			>Orc</option>


  <tr>
    <td><div>Username:</div></td>
    <td><input type="text" name="strUSERNAME" maxlength="25" class="black"></td>
  </tr>
   <tr>
    <td><div>Password:</div></td>
    <td><input type="password" name="strPASSONE" maxlength="32" class="black"></td>
  </tr>
  <tr>
    <td><div>Retype Password(Verification):</div></td>
    <td><input type="password" name="strPASSTWO" maxlength="32" class="black"></td>

    </tr> 

<tr>
    <td><div>Email Address:</div></td>
    <td><input type="text" name="strEMAILONE" maxlength="32" class="black"></td>

    </tr>


<tr>
    <td><div>Email Address(Verification):</div></td>
    <td><input type="text" name="strEMAILTWO" maxlength="32" class="black"></td>

    </tr>
<tr>
<td valign=bottom>Verify Image Text: </td> 
<td><img src="function.imageverify.php" /><br /><input type="text" maxlength="4" name="verify"></td>
</tr>
</table>

</form>

<?

$password="mypassword";
$server="www.myhost.com";
$username="myusername";
mysql_connect($server, $username, $password)  // THIS IS WHERE THE PROBLEMS ARE
$result = mysql_query("INSERT into `signupinfo` (username, password, password2, email, email2, race) values (strUSERNAME,  strPASSONE, strPASSTWO, strEMAILONE, strEMAILTWO, strRACE)");

?>
Anyone have any idea why I might be getting a parse error there?


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

you need a semi colon at the end of the mysql_connect line.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Once the parse error is fixed, the insertion will be the exact same issue as your previous thread. (the $_GET part.)
Post Reply