I'm getting a call to undefined function error

I ran my script on ideone.com and it gave me the following message

Fatal error: Call to undefined function mysql_connect() in /home/CoJP1z/prog.php on line 18

in line 18 I have this code

mysql_connect(“$db_host”,“$db_username”,“$db_pass”) or die (“could not connect to mysql”);

what am I doing wrong?

seems like mysql isn’t configured to work with php.

I assume that www.ideone.com is NOT your site?

The code you supplied is using your “$db_host”,“$db_username”,“$db_pass” and trying to connect to a database on their server.

ideone.com is a site where you can test your scripts for errors… so it’s set up to know the difference… it works for php, css, html, C++, Javascript, JSON, Pearl n a bunch of others… but neither of you said I had an error with my coding so I’m guessing I got it right?

OH YEAH!!!.. n my domain is setup for it because I coded some php tables and ran the pages and those went in fine…

I use the following for dynamically testing scripts and no need to copy and paste to a third-party tester:


for HTML and CSS:
FireFox Html Validator

Php errors are displayed immediately.

HTML errors are shown by using your browser to view source also can use:

CSS errors are checked using the folllowing:

I saw that on this site yesterday and tried it… and I got this error

Warning: ini_set() has been disabled for security reasons in /www/zxq.net/o/p/t/optiq-customtees/htdocs/storeadmin/connect_to_mysql.php on line 3

and lines 1-3 is that code…

You need to install the MySQL module extension for PHP on your server. Also make sure that the MySQL client software is also installed on your server.

I think it is already… I have a few other php files I coded to make tables and those worked fine.

I think it is already… I have a few other php files I coded to make tables and those worked fine.

I just double checked to see what it was and it’s called “sql buddy” and it lets you import and export .sql files, I have to log in with the username and password I created for it, I can add other admins and everything… so that means I already got what I need on there right?..

It looks like your INI_set is working already.
You could try echo INI_get(“show_errors”); and it should return true or 1.

You could also try setting error_reporting(0); and there should be no warning mesge displayed.

It is hard wok ttrying to post a reply using one finger on this Nexus 7.