Jump to content


Photo

Query problem


  • Please log in to reply
3 replies to this topic

#1 shortkid422

shortkid422
  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 21 December 2003 - 04:48 PM

Im having a problem with this query, can someone help me out?
$query1 = "INSERT INTO user(username, userpassword, email) VALUES(\'$username\',\'$userpassword\',\'$email\')";$result1 = mysql_query($query1)	or die(mysql_error());

Need some php work thats cheap and reliable?[br]AIM shortmonkey422[br]MSN shortkid422@hotmail.com[br]Email: shortkid422@hotmail.com

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 21 December 2003 - 08:08 PM

What error message do you get?
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 shortkid422

shortkid422
  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 22 December 2003 - 03:26 AM

i got it fixed, somewhat. There needed to be a space by the user( part. But one problem that im having is the values are not being passed by the form. Here it is:
<?php  session_start(); ?><form action="register_member.php" method="post"><table> <tr>  <td>Please enter your desired username here:</td><td><input type="text" name="" value="<?php echo $username ?>"></td> </tr> <tr>  <td>Enter your password that will be used:</td><td><input type="text" name="" value="<?php echo $user_password1 ?>"></td> </tr> <tr>  <td>Please re-enter your password again:</td><td><input type="text" name="" value="<?php echo $user_password2 ?>"></td> </tr> <tr>  <td>Now please enter your valid email address:</td><td><input type="text" name="" value="<?php echo $email ?>"></td> </tr> <tr>  <td><input type="submit" value="Register!"></td><td><input type="reset" value="Clear"></td> </tr></table></form>

Need some php work thats cheap and reliable?[br]AIM shortmonkey422[br]MSN shortkid422@hotmail.com[br]Email: shortkid422@hotmail.com

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 22 December 2003 - 08:31 AM

Give your form input fields names - username, userpassword & $email
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users