Mysql connection

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
piseypeng
Forum Newbie
Posts: 2
Joined: Mon Oct 24, 2005 10:41 pm

Mysql connection

Post by piseypeng »

Hi All,

I am brand new to PHP and I am really just learning it having installed the compiler for it along with a command-line version of MySQL on my apache server.

I have been trying to connect to this MySQL database but get an error msg. I am using the following line of code to connect:

$link = mysql_connect("localhost", "pisey", "testpisey");
mysql_select_db("cellcard", $link);
$result = mysql_query("SELECT * FROM tbType ORDER BY ordernum", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";


And below is the msg error:

Fatal error: Call to undefined function: mysql_connect() in /var/www/mobile/php/game.php on line 36

Note: I am using PHP4.

So do I need to install or configure anything else on the server?

Any help would be greatly appreciated.

Thanks in advance

PiseyPeng
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

search for "undefined function: mysql_connect()" with Search for all terms selected

ya gotto love the search feature :roll:
Post Reply