- Feb 13, 2003
- 26,252
- 403
- 126
I have a form where I gather some user input and when the user presses submit, the info is stored in a MySQL database. This is done on one .php page (if-else statement to decide if the form was submitted or not).
Now after the info is inserted into the database, I'd like that page to refresh so the user can instantly see the newly inserted data. Problem is, I can't get it to work right. After the query, I tried echo'ing some JavaScript with a "window.location.href" statement and then tried a PHP "header('Location: xxx');" but neither worked and the error I got was a MySQL error, which sorta confused me.
Any suggestions? Basically what I want is how the comment form at pics.bbzzdd.com works. Click "Comments", then see existing ones and at the bottom is a form. Enter comment, click submit, and popup refreshes and you see your comment.
BTW: This is the MySQL error I got: Invalid query: 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 '' at line 1
Now after the info is inserted into the database, I'd like that page to refresh so the user can instantly see the newly inserted data. Problem is, I can't get it to work right. After the query, I tried echo'ing some JavaScript with a "window.location.href" statement and then tried a PHP "header('Location: xxx');" but neither worked and the error I got was a MySQL error, which sorta confused me.
Any suggestions? Basically what I want is how the comment form at pics.bbzzdd.com works. Click "Comments", then see existing ones and at the bottom is a form. Enter comment, click submit, and popup refreshes and you see your comment.
BTW: This is the MySQL error I got: Invalid query: 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 '' at line 1