hello
1. installed xampp, apache, mysql
2. created database and tables
3. added rows to tables
4. able to login to mysql and phpmyadmin without any issues and
perform necessary operations on the database without any issues
in the php code, able to connect to the database
but unable to select the database
your help is much appreciated in advance.
got the error message as
<hr>
connect_host_name(localhost) connect_user_name(root) connect_pass_word(root) connect_data_base(LibraryDataBase)
26 Warning: mysql_select_db(): supplied argument is not a valid
MySQL-Link resource in
C:\Program Files\xampp\htdocs\lskxampp\mpl_web\mpl_include\mpl_database_connection_open.inc
on line 28
error: unable to select the database!:
<hr>
the code snippet is:
<hr>
<?php
include ("header.html");
include ("faq.html");
$connect_host_name = 'localhost:3306';
$connect_user_name = 'root';
$connect_pass_word = 'root';
$connect_data_base = 'LibraryDataBase';
echo "connect_host_name($connect_host_name) connect_user_name($connect_user_name) connect_pass_word($connect_pass_word) connect_data_base($connect_data_base)";
$connection_string = mysql_connect($connect_host_name, $connect_user_name, $connect_pass_word)
|| die ( "error: unable to connect to the database!:" . mysql_error() );
$db_select_string = mysql_select_db($connect_data_base, $connection_string)
//mysql_select_db('LibraryDataBase', $connection_string) ;
|| die ( "error: unable to select the database!: $connect_data_base " . mysql_error() );
//some more php code which does not get executed since
//the error unable to select the database is got
include ("header.html");
?>
<hr>
thank you
kumar