php and mysql
| From: | Zeus | Date: | Thu, 14 Nov 2002 07:12:42 +0000 |
| Subject: | php and mysql | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-16981@lists.php.net to get a copy of this message | ||
i write this code, veru simple code about testing inserting into database
MySQL. I found a little trouble, wich is the data i inserted in the form
doesn't show up in the database, since i still new with PHP, i cannot solve
this problem,
what's wrong with my code??
thanks
<?PHP
/////////////////////
//configure ///
/////////////////////
include("config.php");
/////////////////////
//connect ke mysql///
/////////////////////
mysql_connect($db_host,$db_user,$db_pass) or die ("cannot connect");
mysql_select_db($db_base) or die ("cannot select db");
///////////////////////////////////
//inserting to database //
//////////////////////////////////
$submit=mysql_query("INSERT INTO links_balon (banner, teks, alamat) VALUES
('$banner', '$teks', '$alamat')") or die ("tak ada data yang
masuk");
///////////////////////////////////
//Form //
///////////////////////////////////
echo "MASUKAN LINKS DI SINI<p>";
echo "<form method=post action=$php_self>"
."Insert Title and Descriptiion of a links<br>"
."<textarea name=\"teks\" rows=\"10\"
cols=\"30\"></textarea><br>"
."insert the links of the site<br>"
."<input type=\"text\" name=\"alamat\"><br>"
."Insert the file name of the banner<br>"
."<input type=\"text\" name=\"banner\"><p>"
."<input type=\"submit\" name=\"submit\">"
."</form>";
?>
================================
:.zeus:.
http://www.redrival.com/zeussama