Jump to content

Select sql from an array


brooksh

Recommended Posts

<?php
$areas = array( $_POST['area']);
$comma_seperated=implode(",",$areas);
$nested_array=serialize($comma_seperated);
$make_safe_query=mysql_real_escape_string($nested_array);
$sql="SELECT DISTINCT City FROM listings WHERE area IN ('$make_safe_query')";

mysql_query($sql);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.