Re: String variable

From: Date: Sun, 11 Jan 2009 17:07:15 +0000
Subject: Re: String variable
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-286033@lists.php.net to get a copy of this message
Ashley Sheridan wrote:
On Sun, 2009-01-11 at 14:36 +0000, Ashley Sheridan wrote:
On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote:
Hello, I am trying yo get THIS: where ref_id = '1234' from this. $where="where ref_id="."'$Reference[$x][ref_id]'"; but i certainly have a quote problem. Any help? Thanks Mike
It should look like this: $where="where ref_id="'{$Reference[$x][ref_id]}'"; Ash www.ashleysheridan.co.uk
Sorry, it should look like this: $where="where ref_id='{$Reference[$x][ref_id]}'"; I missed taking an extra quote mark out Ash www.ashleysheridan.co.uk
actually unless ref_id is a constant (which i doublt) you may be best going with: $where = "WHERE ref_id='" . $Reference[$x]['ref_id'] . "'"; keep the php and sql seperate and you'll find it much easier to see in you're editor (imho) :)

« previous php.general (#286033) next »