Fatal error: Call to undefined function mysql_connect()

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
IGS6764
-


Joined: 21 Apr 2005
Posts: 3

PostPosted: Thu Apr 21, 2005 10:03 pm    Post subject: Fatal error: Call to undefined function mysql_connect() Reply with quote

Let me make this easier..since I screwed up the first post about blank pages

in lib.php
Code:

<?php


error_reporting(E_ALL ^ E_NOTICE);
include("./datalist.php");

function sql($statment)
{
   
   global $Translation;
   
      $dbhost = "http://127.0.0.1:3306";
      $dbuser = "foo";
      $dbpass = "password";
      $dbname = "demo";
      
      /****** Connect to MySQL ******/
<!-- error occurs here!!!-->  if(!mysql_connect($dbhost, $dbuser, $dbpass))
      {
         echo StyleSheet() . "\n\n<div class=Error>";
         echo $Translation["error:"] . mysql_error();
         echo "</div>";
         exit;
      }
      /****** Select DB ********/
      if(!mysql_select_db($dbname))
      {
         echo StyleSheet() . "\n\n<div class=Error>";
         echo $Translation["error:"] . mysql_error();
         echo $Translation["if you haven't set up"];
         echo "</div>";
         exit;
      }
   
   if(!$result = mysql_query($statment))
   {
         echo StyleSheet() . "\n\n<div class=Error>";
      echo "<br><b>" . $Translation["sql error:"] . "</b><br><br>
           <strong>" . $Translation["query:"] . "</strong><br> $statment<br><br>
           " . mysql_error();
         if(stristr($statment, "select ")) echo ".<br>" . $Translation["if you haven't set up"];
         echo "</div>";
         echo "<a href=\"javascript:history.go(-1);\">" . $Translation["< back"] . "</a>";
      exit;
   }
   return $result;
}


function NavMenus()
{
   global $Translation;

   $t = time();
   $menu  = "<select name=nav_menu onChange='window.location=document.myform.nav_menu.options[document.myform.nav_menu.selectedIndex].value;'>";
   $menu .= "<option value='#' class=SelectedOption style='color:black;'>" . $Translation["select a table"] . "</option>";
   $menu .= "<option value='tradelead_view.php?t=$t' class=SelectedOption>tradelead</option>";
   $menu .= "</select>";
   return $menu;
}

function StyleSheet()
{
   return "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">";
}
?>

Line 7 If(!mysql_connect...);
is throwing a fatal error on the mysql_connect function and I cannot figure out why...I'm not the best PHP hack but I am baffled...

Anyone with an idea? Would be greatly appreciated before my full head of hair becomes a cueball...

Thx...IGS[/b]
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Thu Apr 21, 2005 10:25 pm    Post subject: Reply with quote

You need to enable the myswl extension in your php.ini file.
Find the line "extenion=php_mysql.dll" and remove the semicolon in front of it.
(not sure if that is the exact line, something like that).
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group