Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call to undefined function: mysql_connect() ????????

Status
Not open for further replies.

jewel464g

Technical User
Jul 18, 2001
198
US
This is my error message.

Fatal error: Call to undefined function: mysql_connect() in /var/ on line 6


I just had someone install MYSQL on a Linux server for me so that my admin section to a site would work. I've used this same script in the past on Windows boxes are it's worked fine. This is the first time I've used it on a linux box, and the admin of the box said he's not sure if mysql needs configuring or anything. Below is my PHP script.

<? require (&quot;includes/top_boe.php&quot;); ?>
<?


//connect to database and open it
$db = mysql_connect(&quot;localhost&quot;, &quot;root&quot;);
mysql_select_db(&quot;cadb&quot;,$db);
$tableName = &quot;jobs&quot;;
$pageName = &quot;boe_jobs.php&quot;;
$result = mysql_query(&quot;SELECT * FROM $tableName ORDER BY sequence&quot;,$db);
echo &quot;<table border=0 cellpadding=2 cellspacing=2><tr><td><b>Location</b></td><td><b>Title</b></td></tr><tr><td colspan=2><b>Description</b></td></tr>&quot;;
$i=0;
while ($myrow =mysql_fetch_array($result)) {


printf(&quot;<tr><td>%s</td><td><b>%s</b></td></tr><tr><td colspan=2>%s</td></tr>&quot;, $myrow[&quot;category&quot;], $myrow[&quot;title&quot;], $myrow[&quot;description&quot;]);
$i++;
}
echo &quot;</table>&quot;;
?>
<br><br><br><br>

<? require (&quot;includes/bottom_boe.php&quot;); ?>


I ran the phpinfo() command and this is what it gave me.
So does anyone know why it isn't working??? I appreciate any help.

Jewel When faced with a decision, always ask, 'Which would be the most fun?'
 
You need the php/mysql bindings/libs/whatever you want to call them. In Mandrake 9.0, it's called &quot;php-mysql&quot;. Just figure out whatever the package name is and install it via your Distribution's preferred method. Or, if you feel like getting your hands dirty, download the source and compile it with the option &quot;--enable-mysql&quot; (I think that's it).

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top