Inserting data into mySQL...?
[email protected] ("Oscar J. Ramos")
| Newsgroups | php.install |
|---|---|
| Message-ID | <[email protected]> |
mySQL version 4.1
php 5
OS Windows 2003 server
IIS
Running php as cgi
Php.ini file configurations
Extension_dir = "c:/php/ext/"
Extension=php_mysql.dll
PHP code used.
?>
@ $db = mysql_connect("localhost", "username", "password");
if (!$db)
{
echo "<center>Error: Could not connect to database. Please try
again later.</center>";
exit;
}
$id = '';
$name = 'Oscar J. Ramos';
echo 'Test 1 ' . $name . '<br>';
mysql_select_db("dbtest");
$query = "insert into tbltest values
('".$id."', '".$name."')";
$result = mysql_query($query);
echo $name;
?>
added path c:\php
Oscar J. Ramos
Technology Support Technician
By Design LLC.
(212) 500 - 4466
x4466
[email protected]
www.bydesignllc.com