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

Posted by moosus on 06/07/06 00:47

Amazing what a machine reboot and a bit of outside help will do

Rik

Thanks for the heads up on the ` and ' ... I sure I tried them all but I
must have stuffed something along the way

All working fine now :)

WRT the DB fields ... I have to do a little more research about MySQL and DB
fields as I'm not real sure how to use the other field types.

Something like a session id can contain both numbers and letters -> hence
making the field text.

Fields are explained below if you care to direct me to a better option it
would be appreciated

`id` smallint(5) NOT NULL auto_increment, = number id
`sessid` text NOT NULL, = $PHPSESSID
`name` text NOT NULL, = Person's Name
`company` text NOT NULL, = Company Name
`street` text NOT NULL, = Address details
`suburb` text NOT NULL, = Address details
`state` text NOT NULL, = Address details
`postcode` text NOT NULL, = Address details
`country` text NOT NULL, = Address details
`cphone` text NOT NULL, = Company phone number ie (07) 555-3993
`cfax` text NOT NULL, = Company fax number ie (07) 555-3993
`renew` decimal(5,0) default '0', = Monetary value ie $125.00
`n2` text NOT NULL, = Person's Name
`n3` text NOT NULL, = Person's Name
`n4` text NOT NULL, = Person's Name
`n5` text NOT NULL, = Person's Name
`n6` text NOT NULL, = Person's Name
`n7` text NOT NULL, = Person's Name
`n8` text NOT NULL, = Person's Name
`n9` text NOT NULL, = Person's Name
`n10` text NOT NULL, = Person's Name
`tickets` int(2) NOT NULL default '0', = number of tickets ie 10
`industrytype` text NOT NULL, = Industry Type (from drop down)
`affiliation` text NOT NULL, Affiliation (from drop down)
`rego` text NOT NULL, = YES / NO (tick box)
`cctype` text NOT NULL, = type (from drop down)
`nameoncard` text NOT NULL, = Person's Name
`expiry` text NOT NULL, = Date (mm/yyyy)
`totalcharge` decimal(6,0) NOT NULL default '0', = Monetary value ie
$125.00


Cheers
Moosus



in article d027c$448617ab$8259c69c$8775@news1.tudelft.nl, Rik at
luiheidsgoeroe@hotmail.com wrote on 7/6/06 10:03 AM:

> moosus wrote:
>> $sql = "SELECT * FROM afta WHERE sessid=$usersession LIMIT 1";
>
> It shouldn't give this partivular error, but what if you try:
> $sql = "SELECT * FROM afta WHERE `sessid`='$usersession' LIMIT 1";
>
> (backticks around columng name, single quotes around $usersession, always
> good practise).
>
> On a side note, contemplate the types of your database fiels. I suspect a
> lot of them that are now 'text' should be something else.
>
> Grtz

 

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

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