View previous topic :: View next topic |
Author |
Message |
IGS6764 -
Joined: 21 Apr 2005 Posts: 3
|
Posted: Thu Apr 21, 2005 10:03 pm Post subject: Fatal error: Call to undefined function mysql_connect() |
|
|
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 |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Thu Apr 21, 2005 10:25 pm Post subject: |
|
|
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 |
 |
 |
|