You are here: Php mysql - messing with my head « All PHP « IT news, forums, messages
Php mysql - messing with my head

Posted by moosus on 06/06/06 23:17

G'day all

I'm hoping that someone can find where I have screwed thing up ... I have
been looking at this for 48hrs and still cant see it.

I have a registration form adding info to a db ... This is working fine ...
On submit I redirect to print.php?ssid=$ssid (where $ssid = $PHPSESSID) ...
This works fine giving a url like
print.php?ssid=9d3ba24e97653f326f2abe689d2b3362

The code on my print.php is fairly easy

------------------------------CODE
require_once('dbc.php');
require('class.inputfilter.php'); //Clean String Class
$myFilter = new InputFilter(); //Full Clean

if (isset($_GET['ssid']) ) {
$usersession=$myFilter->process($_GET['ssid']);

//Define Query
$sql = "SELECT * FROM afta WHERE sessid=$usersession LIMIT 1";


if ($r = mysql_query($sql)) { // Run the query
$row = mysql_fetch_array ($r); // Retrieve the information.

------------------------------CODE

But it throws an error

------------------------------ERROR
Query = SELECT * FROM afta WHERE sessid=9d3ba24e97653f326f2abe689d2b3362
LIMIT 1
Unknown column '9d3ba24e97653f326f2abe689d2b3362' in 'where clause'
------------------------------ERROR

I'm not real sure if it is a php or sql problem but when I change the query
to actually have a ssid in it then it works
Ie:
$sql = "SELECT * FROM afta WHERE sessid=9d3ba24e97653f326f2abe689d2b3362
LIMIT 1";


------------------------------ MySQL Table Structure
CREATE TABLE `afta` (
`id` smallint(5) NOT NULL auto_increment,
`sessid` text NOT NULL,
`name` text NOT NULL,
`company` text NOT NULL,
`street` text NOT NULL,
`suburb` text NOT NULL,
`state` text NOT NULL,
`postcode` text NOT NULL,
`country` text NOT NULL,
`cphone` text NOT NULL,
`cfax` text NOT NULL,
`renew` decimal(5,0) default '0',
`n2` text NOT NULL,
`n3` text NOT NULL,
`n4` text NOT NULL,
`n5` text NOT NULL,
`n6` text NOT NULL,
`n7` text NOT NULL,
`n8` text NOT NULL,
`n9` text NOT NULL,
`n10` text NOT NULL,
`tickets` int(2) NOT NULL default '0',
`industrytype` text NOT NULL,
`affiliation` text NOT NULL,
`rego` text NOT NULL,
`cctype` text NOT NULL,
`nameoncard` text NOT NULL,
`expiry` text NOT NULL,
`totalcharge` decimal(6,0) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=8 ;


Any help would be appreciated as I am fully lost

Cheers moosus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация