Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5056

Database connection Error (Fatal error: Uncaught Error: Call to undefined function) [duplicate]

$
0
0

I have summed up this code to connect with my database to fetch results but it keeps giving me this error

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in ////config.php:7 Stack trace: #0 ////index.php(6): include() #1 {main} thrown in \\\config.php on line 7

This is config.php

<?php$db_host='localhost';$db_user='root';$db_pwd='';$database='testing';if(!mysql_connect($db_host,$db_user,$db_pwd))die("can't Connect to Database");if(!mysql_select_db($database))die("can't Select Database");?>

And this is how I'm fetching it on my page

include('config.php');$s1=$_REQUEST["n"];$select_query="select * from product where name like '%".$s1."%'";$sql=MySQLi_query($select_query) or die (mysql_error());$s="";while($row=mysql_fetch_array($sql))

Can you please tell me what am I doing wrong? I'm new to this.


Viewing all articles
Browse latest Browse all 5056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>