List Info

Thread: Unable to select database




Unable to select database
user name
2006-12-12 10:25:09
<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-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

Unable to select database
user name
2006-12-12 15:43:35
Getting any error messages?


--~--~---------~--~----~------------~-------~--~----~
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-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

Unable to select database
user name
2006-12-12 15:56:16
do you compile PHP with MySQL support?

On 12/12/06, Chris Ramsay < raz.netgmail.com">raz.netgmail.com> wrote:

Getting any error messages?







--
Sem mais para o momento,
Rodrigo Souza

--------------------------------------------------------------------------------
:: Rodrigo Souza dos Santos
:: Curitiba - Paraná - Brasil
:: rodrigosouzadossantosgmail.com">rodrigosouzadossantosgmail.com
--------------------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
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-PHPgooglegroups.com
To unsubscribe from this group, send email to Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )