Or you could just remove $form, and don't put an else on the action, and the form will magically show again..

Or you could just remove $form, and don't put an else on the action, and the form will magically show again..
Thanks Caleb, I'm going to go with you and Beau's idea.
There are bad ways of doing things.. :\ I'm not saying echoing out a variable is a bad thing, don't take it that way as it's just a way to do something..
But there are appropriate and inappropriate ways of doing something.. like using sprintf here:
when you could just as easily, and recommended do:PHP Code:$username = "Bla";
$password = "blabla";
$credentials = sprintf( "%s:%s", $username, $password );
PHP Code:$credentials = "{$username}:{$password}";
New problem:
That code doesn't update the mysql database.PHP Code:mysql_query("UPDATE `users` (`firstname`, `lastname`, `nickname`, `location`, `email`, `gender`, `bio`, `favmovies`, `favmusic`, `favbooks`) VALUES ('".$fname."', '".$lname."', '".$nname."', '".$location."', '".$email."', '".$gender."', '".$bio."', '".$fmovies."', '".$fmusic."', '".$fbooks."',)");
dunno if it does anything but theres a random comma at the end :]
@ Dentafrice: is there a difference between '".$bio."' and '$bio'? Always wanted to know :]
Waz ;]
Last edited by wazup999; 17-11-2008 at 01:00 AM.
mysql_query( "UPDATE `users` (`firstname`, `lastname`, `nickname`, `location`, `email`, `gender`, `bio`, `favmovies`, `favmusic`, `favbooks`) VALUES ('$fname', '$lname', '$nname', '$location', '$email', '$gender', '$bio', '$fmovies', '$fmusic', '$fbooks')" ) or die( mysql_error() );New problem:
That code doesn't update the mysql database.PHP Code:mysql_query("UPDATE `users` (`firstname`, `lastname`, `nickname`, `location`, `email`, `gender`, `bio`, `favmovies`, `favmusic`, `favbooks`) VALUES ('".$fname."', '".$lname."', '".$nname."', '".$location."', '".$email."', '".$gender."', '".$bio."', '".$fmovies."', '".$fmusic."', '".$fbooks."',)");
''s can't handle inline variables..
^^ That won't work.PHP Code:$text = "Hello, world!";
echo '$text';
^^ This will..PHP Code:$text = "Hello, world!";
echo "$text";
Caleb, when I use your code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`firstname`, `lastname`, `nickname`, `location`, `email`, `gender`, `bio`, `fav' at line 1
BOX! go and read a damn tutorial site and stop asking so many questions, 99% of them will be answered on a tutorial site.
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
that's why you need to use UPDATE `table` SET `field`='$value', `field`='$value'
Want to hide these adverts? Register an account for free!