<?php include("connect.php");?>
<?php include("cityname.php");?>
<?php // select from city
$query= "select city_id from city where(city_name='$city_name')";
//exe query
$result=mysql_query($query) or die();
$row=mysql_fetch_array($rsult);
$city_id=$row['city_id'];
// then insert into location
if($city_id){
$l_id=$_POST['l_id'];
$location=$_POST['location'];
$q = "INSERT INTO location (loc_id,city_id,loc_city)VALUES('','$city_id','$location')";
$re=mysql_query($q) or die (mysql_error());
if($re){
echo "roger that";
}
}
?>
when i am using this code following i find this code
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\newzstreet\addloc1.php on line 29
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\newzstreet\addloc1.php on line 29
currently i am using Apache server