Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

after sql echo


ghost's Avatar
0 0

Hey … This is probably really basic … But i dont know how to do it … After someone presses submit on my form the INSERT php/sql code is exicuted plainly like this :

$sql = 'INSERT INTO dotticms.navigation (name, link, target, status) VALUES (\'new\', \'new\', NULL, \'1\');

I want a peice of code to be exicuted after the person has pressed submit and sql INSERT'ing has completed ….


ghost's Avatar
0 0
$sql = "your sql query";
mysql_query($sql) or die("SQL query failed, please try again"); //Will kill the script if it goes wrong

//Since we have got this far in the script, nothing has gone wrong
echo "whatever";
blah();
blah();
blah();

ghost's Avatar
0 0

mastergamer wrote:

$sql = "your sql query";
mysql_query($sql) or die("SQL query failed, please try again"); //Will kill the script if it goes wrong

//Since we have got this far in the script, nothing has gone wrong
echo "whatever";
blah();
blah();
blah();

ahhhh yea … forgot about killing the script


spyware's Avatar
Banned
0 0

djdotti wrote: ahhhh yea … forgot about killing the script

It's not needed to run a SQL command, it comes in handy though, shows you where the error lies.


ghost's Avatar
0 0

yes thankyou all Dotti.