Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- MySql


BarryStCyr - 5:50 am on Sep 23, 2010 (gmt 0)


Try this example from php.net.

<html>
<head>
Information to login to database here.
</head>

<body>
<?php

$sql = 'INSERT INTO aaa (username,password) ' .
'values (User3, Carpet)';
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
if (!mysql_select_db('database_name')) {
die('Could not select database: ' . mysql_error());
}
$result = mysql_query($sql);
if (!$result) {
die('Could not query:' . mysql_error());
}

mysql_close($link);

?>
</body>
</html>


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4205572.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com