I have only been doing php for about 24 hours and have read about 50 tutorials discussing the subject. I am confused though because I can't get my script to work like I want it to. Last night I had a hard time figuring out how to connect to a data bases, but I got that part down now. Here is the code that I am struggling with.
But if
the code will work, but obviously it does not take any thing from the form.
I am assuming I don't understand how variables work in php. Can ne one see what I am doing wrong?
Code:
<?php
//get post data
$mmame = addslashes($_Post['Name']);
//execute the SQL query and return records
$frrt = 'INSERT INTO `Projects` (`Name`, `munb`, `address1`, `address2`, `city`, `stae`, `zip`, `email`, `dec`) VALUES ('$mmame', NULL, \'tree\', \'speed\',
\'weel\', \'vop\', \'nosit\', \'mooe\', \'beooe\');';
$result = mysql_query($frrt) or die("$query FAILED because ".mysql_error());
echo "Thank you! Information entered.<a href='swift4.php'>swift4</a>\n '";
?>
But if
Code:
$frrt = 'INSERT INTO `Projects` (`Name`, `munb`, `address1`, `address2`, `city`, `stae`, `zip`, `email`, `dec`) VALUES (\'gfgnxx\', NULL, \'fdsgnhdsfgbsdfg\', \'fgbf\', \'gfg\', \'fgnfg\', \'sfgbdfsgnb\', \'dfgndfgn\', \'dfghnghmngh\');';
I am assuming I don't understand how variables work in php. Can ne one see what I am doing wrong?
Comment