<html>
<body>
<?php
$link = mysql_connect('localhost','root','sangram321');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$db_selected = mysql_select_db('sangram', $link);
if (!$db_selected) {
die ('Can't use foo : ' . mysql_error());
}
else
echo "database selected";
$query = "INSERT INTO test VALUES
('sangram','1234')";
mysql_query($query);
mysql_close();
echo "successfully data inserted...";
?>
</body>
</html>
mysql user id is root and password is sangram321
i am able to coonnect from command prompt but not from php
code
Help me ...
thanks...
--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.
For information or project assistance please visit :
http://www.360psg.com
You received this message because you are subscribed to the
Google Groups "Professional PHP Developers" group.
To post to this group, send email to Professional-PHP googlegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribe googlegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---
|