|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
pear db::connect problem
I have successfully installed pear but it is not connecting to my mysql database and it is not giving an error.
The first script doesnt go beyond DB::Connect and doesnt display hello 1. The second script(pure php) displays both hello1 and results of the query. what could be the problem <?php require_once 'DB.php'; $uname = 'root'; $hostn = 'localhost'; $db_name = 'employees'; $connection ="mysql://$uname:@$hostn/$db_name"; $db =& DB::connect($connection); echo "hello1"; if (DB::isError($db)) { echo $db->getDebugInfo(); } echo "hello2"; ?> <?php $uname = "root"; $hostn = "localhost"; $db_name = "employees"; $db = mysql_connect($hostn,$uname); mysql_select_db($db_name,$db); $result = mysql_query("SELECT * FROM employees",$db); echo "hello1\n"; printf("First Name: %s<br>\n", mysql_result($result,0,"first")); printf("Last Name: %s<br>\n", mysql_result($result,0,"last")); printf("Address: %s<br>\n", mysql_result($result,0,"address")); printf("Position: %s<br>\n", mysql_result($result,0,"position")); ?> |
|
#2
|
|||
|
|||
|
I have the same problem... Did you resolve it? thanks
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > pear db::connect problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|