I have this code and a value in the url that I call with the function: $ _GET (called cID = (Number)) I'm stuck and I can not make the query I do with the json, the only way it works is adding the number manually, but I need you to take it from the browser.
in this query:
$query = mysqli_query($con, "SELECT * FROM calendar where customers_id = '11'");
the number 11 must be taken from the url with the function $ _GET I have placed the following code and the table disappears, it does not read the url and it returns a value of zero:
I've tried with:
$query = mysqli_query($con, "SELECT * FROM calendar where customers_id = '$_GET['cID']'");
and with:
$query = mysqli_query($con, "SELECT * FROM calendar where customers_id = '.$_GET['cID'].'");
and with:
$query = mysqli_query($con, "SELECT * FROM calendar where customers_id = '.$HTTP_GET_VARS['cID'].'");
and it does not work
this is the original URL the variable is & cID = (value) and the value of & cID = (value) is what I need to general the Query:
here I leave the complete code but it does not work, could you help me with this:
if($type == 'fetch')
{
$action = (isset($_GET['action']) ? $_GET['action'] : '');
$events = array();
$query = mysqli_query($con, "SELECT * FROM calendar where customers_id = '$_GET['cID']'");
while($fetch = mysqli_fetch_array($query,MYSQLI_ASSOC))
{
$e = array();
$e['id'] = $fetch['id'];
$e['title'] = $fetch['title'];
$e['start'] = $fetch['startdate'];
$e['end'] = $fetch['enddate'];
$e['customers_id'] = $_GET['cID'];
array_push($events, $e);
}
echo json_encode($events);
}