Jump to content

Query based on URL


bravo14

Recommended Posts

Hi Guys

 

I have the following code

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include('includes/connect.php'); 

$sql=("SELECT * FROM `tbl_pages` WHERE `page_address_identifier` = '" . mysql_real_escape_string(intval($_GET['page_id'])) . "' LIMIT 1");
echo $sql;
$result=mysql_query($sql);
if(mysql_num_rows($result)==0) {
die("No record found");
}
$row = mysql_fetch_array($result);
?> 

 

from the following url

http://79.170.44.125/platinumbrides.co.uk/page.php?page_id=events

 

The following query is then perfromed,

SELECT * FROM `tbl_pages` WHERE `page_address_identifier` = '0' LIMIT 1 b

 

I cannot see where the 0 is coming from

 

Any ideas what I have done wrong?

Link to comment
https://forums.phpfreaks.com/topic/192438-query-based-on-url/
Share on other sites

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.