473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

php variable in sql string

Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.
Jan 17 '07 #1
27 10085

user wrote:
Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.
Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.

Jan 17 '07 #2
Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
..'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:
user wrote:
>>Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.


Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.
Jan 17 '07 #3

user wrote:
Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:
user wrote:
>Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.

Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.
You can try this also:
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
'".$cccb_id."'
order by member";

or, I think this shoul work too:

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
\"{$cccb_id}\"
order by member";

Jan 17 '07 #4
user wrote:
Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:
>user wrote:
>>Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.

Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.
Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
Removing the double quotes around it will solve your problem.

If it is not numeric, then you need single quotes around it, not double.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 17 '07 #5
user wrote:
Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.
You need to concatenate, i.e.
$query4 = "some stuff " . $cccb . " some more stuff";

Make sure you allow for adequate spacing where the different parts meet,
as the concatenation will literally attach whatever you put together
into one new string.
Jan 17 '07 #6
Results below, had tried, none worked sorry to say, but thanks none the
less.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
'".$cccb_id."' order by member;";

query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '' order by
member;

and

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
\"{$cccb_id}\" order by member;";

query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "" order by
member;


iulian.ilea wrote:
user wrote:
>>Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:

>>>user wrote:
Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.
Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.


You can try this also:
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
'".$cccb_id."'
order by member";

or, I think this shoul work too:

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
\"{$cccb_id}\"
order by member";
>
Jan 17 '07 #7
Nope but thanks anyway.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member;";

query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '' order by
member;

Jerry Stuckle wrote:
user wrote:
>Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:
>>user wrote:

Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require
file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes
depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.


Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.

Is $cccb_id a numeric value? If so, it shouldn't be in quotes. Removing
the double quotes around it will solve your problem.

If it is not numeric, then you need single quotes around it, not double.
Jan 17 '07 #8
user wrote:
Jerry Stuckle wrote:
>user wrote:
>>Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:

user wrote:

Have require file with several query stings in it.
>
Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require
file I
can not seem to insert string.
>
$cccb_id is sting..... to be inserted into $query4 and changes
depending
on user input.
>
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";
>
output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064
>
as you can see, "$cccb_id" is not in query string.
>
any help will be appreciated.

Count your double quotes:

$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";

So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.

Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
Removing the double quotes around it will solve your problem.

If it is not numeric, then you need single quotes around it, not double.
Nope but thanks anyway.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member;";

query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '' order by
member;
(Top posting fixed)

Whoops - I missed one important thing. It looks like $cccb_id is empty.

Try echoing this to the screen before you build your select statement.

P.S. Please don't top post. Thanks.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 17 '07 #9

variable is not empty. As explained earlier this same sql script runs
fine if placed inside the php program. It is just when it is located
within the require "db.inc" file that the variable substitution does not
work.

Appreciate your top post request, but refuse to join the flat earth society.

Jerry Stuckle wrote:
user wrote:
>Jerry Stuckle wrote:
>>user wrote:

Tried those already.....

'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........

ZeldorBlat wrote:

user wrote:
>
>Have require file with several query stings in it.
>>
>Depending on user input one of strings is selected. Everything going
>along smoothly until I wanted to also input a variable in string.
>If I
>put string in program works ok, but, if I use string from require
>file I
>can not seem to insert string.
>>
>$cccb_id is sting..... to be inserted into $query4 and changes
>depending
>on user input.
>>
>$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>',member_lname) as 'member' from member_cccb_lnk join member on
>(member.member_no = member_cccb_lnk.member_no) join cccb on
>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
>order by member";
>>
>output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>',member_lname) as 'member' from member_cccb_lnk join member on
>(member.member_no = member_cccb_lnk.member_no) join cccb on
>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
>memberError 1064
>>
>as you can see, "$cccb_id" is not in query string.
>>
>any help will be appreciated.
>
>
>
>
>
>
Count your double quotes:
>
$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id" order by
member";
>
So your $cccb_id isn't inside the quotes. You probably want to either
remove those quotes so the variable is inserted into the string
automatically or add .'s on both sides of $cccb_id.
>

Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
Removing the double quotes around it will solve your problem.

If it is not numeric, then you need single quotes around it, not double.
Nope but thanks anyway.
>
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member;";
>
query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '' order by
member;
>

(Top posting fixed)

Whoops - I missed one important thing. It looks like $cccb_id is empty.

Try echoing this to the screen before you build your select statement.

P.S. Please don't top post. Thanks.

Jan 18 '07 #10
user wrote:
Jerry Stuckle wrote:
>user wrote:
>>Jerry Stuckle wrote:

user wrote:

Tried those already.....
>
'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
and $cccb_id and [cccb_id] and ........
>
>
>
ZeldorBlat wrote:
>
>user wrote:
>>
>>Have require file with several query stings in it.
>>>
>>Depending on user input one of strings is selected. Everything going
>>along smoothly until I wanted to also input a variable in string.
>>If I
>>put string in program works ok, but, if I use string from require
>>file I
>>can not seem to insert string.
>>>
>>$cccb_id is sting..... to be inserted into $query4 and changes
>>depending
>>on user input.
>>>
>>$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>',member_lname) as 'member' from member_cccb_lnk join member on
>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
>>order by member";
>>>
>>output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>',member_lname) as 'member' from member_cccb_lnk join member on
>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
>>memberError 1064
>>>
>>as you can see, "$cccb_id" is not in query string.
>>>
>>any help will be appreciated.
>>
>>
>>
>>
>>
>>
>>
>Count your double quotes:
>>
>$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id"
>order by
>member";
>>
>So your $cccb_id isn't inside the quotes. You probably want to
>either
>remove those quotes so the variable is inserted into the string
>automatically or add .'s on both sides of $cccb_id.
>>

Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
Removing the double quotes around it will solve your problem.

If it is not numeric, then you need single quotes around it, not
double.

Nope but thanks anyway.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member;";

query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = ''
order by
> member;

(Top posting fixed)

Whoops - I missed one important thing. It looks like $cccb_id is empty.

Try echoing this to the screen before you build your select statement.

P.S. Please don't top post. Thanks.


variable is not empty. As explained earlier this same sql script runs
fine if placed inside the php program. It is just when it is located
within the require "db.inc" file that the variable substitution does not
work.

Appreciate your top post request, but refuse to join the flat earth
society.
(Top posting fixed - again)

As I said - did you actually try to echo the variable to the screen to
see what's in it?

And if you don't follow normal usenet conventions, don't expect to get a
lot of help from this newsgroup. You're the one asking for help. You
should follow the established conventions.

So please don't top post. Or don't expect much for answers.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 18 '07 #11
user wrote:
variable is not empty. As explained earlier this same sql script runs
fine if placed inside the php program. It is just when it is located
within the require "db.inc" file that the variable substitution does not
work.
Google: scoping.
Appreciate your top post request, but refuse to join the flat earth society.
Do you tell jokes punch-line first too?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jan 18 '07 #12
user wrote:
Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file I
can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes depending
on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.
Try:

$query4 = "select cccb.cccb_name as cccb, CONCAT(member_fname,'
',member_lname) as member from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member";

If $cccb_id has a value in it it will show up in the output. Notice I
removed the single quotes from around cccb and member as they are not
needed. Use backticks (`) if you must. Always remember, to include
variables whithin strings the entire string must be enclosed in double
quotes or the variables won't get parsed.

Norm
Jan 19 '07 #13
Jerry,

Read posts and reply or don't. That is your decision.

P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!

Have a nice day!

Jerry Stuckle wrote:
user wrote:
>Jerry Stuckle wrote:
>>user wrote:

Jerry Stuckle wrote:

user wrote:
>
>Tried those already.....
>>
>'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
>.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
>and $cccb_id and [cccb_id] and ........
>>
>>
>>
>ZeldorBlat wrote:
>>
>>user wrote:
>>>
>>>Have require file with several query stings in it.
>>>>
>>>Depending on user input one of strings is selected. Everything
>>>going
>>>along smoothly until I wanted to also input a variable in
>>>string. If I
>>>put string in program works ok, but, if I use string from
>>>require file I
>>>can not seem to insert string.
>>>>
>>>$cccb_id is sting..... to be inserted into $query4 and changes
>>>depending
>>>on user input.
>>>>
>>>$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>>',member_lname) as 'member' from member_cccb_lnk join member on
>>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
>>>"$cccb_id"
>>>order by member";
>>>>
>>>output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>>',member_lname) as 'member' from member_cccb_lnk join member on
>>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
>>>memberError 1064
>>>>
>>>as you can see, "$cccb_id" is not in query string.
>>>>
>>>any help will be appreciated.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>Count your double quotes:
>>>
>>$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id"
>>order by
>>member";
>>>
>>So your $cccb_id isn't inside the quotes. You probably want to
>>either
>>remove those quotes so the variable is inserted into the string
>>automatically or add .'s on both sides of $cccb_id.
>>>
>
Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
Removing the double quotes around it will solve your problem.
>
If it is not numeric, then you need single quotes around it, not
double.
>
Nope but thanks anyway.
>
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member;";
>
query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = ''
order by
member;
>

(Top posting fixed)

Whoops - I missed one important thing. It looks like $cccb_id is empty.

Try echoing this to the screen before you build your select statement.

P.S. Please don't top post. Thanks.

>
variable is not empty. As explained earlier this same sql script runs
fine if placed inside the php program. It is just when it is located
within the require "db.inc" file that the variable substitution does not
work.
>
Appreciate your top post request, but refuse to join the flat earth
society.
>

(Top posting fixed - again)

As I said - did you actually try to echo the variable to the screen to
see what's in it?

And if you don't follow normal usenet conventions, don't expect to get a
lot of help from this newsgroup. You're the one asking for help. You
should follow the established conventions.

So please don't top post. Or don't expect much for answers.
Jan 19 '07 #14
Message-ID: <mn*********************@bgtnsc04-news.ops.worldnet.att.net>
from user contained the following:
>P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!
Posting in a sensible manner in a technical forum such as this is not
flat earth mentality.

Thinking it is marks you out as singularly clueless.

Fine if you want to solve your own problems.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jan 19 '07 #15
Rik
user wrote:
Read posts and reply or don't. That is your decision.

Indeed it is. Another regular poster gone.
*plonk*
--
Rik Wasmus
Jan 19 '07 #16
user wrote:
Jerry Stuckle wrote:
>user wrote:
>>Jerry Stuckle wrote:

user wrote:

Jerry Stuckle wrote:
>
>user wrote:
>>
>>Tried those already.....
>>>
>>'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
>>.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
>>and $cccb_id and [cccb_id] and ........
>>>
>>>
>>>
>>ZeldorBlat wrote:
>>>
>>>user wrote:
>>>>
>>>>Have require file with several query stings in it.
>>>>>
>>>>Depending on user input one of strings is selected. Everything
>>>>going
>>>>along smoothly until I wanted to also input a variable in
>>>>string. If I
>>>>put string in program works ok, but, if I use string from
>>>>require file I
>>>>can not seem to insert string.
>>>>>
>>>>$cccb_id is sting..... to be inserted into $query4 and changes
>>>>depending
>>>>on user input.
>>>>>
>>>>$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>>>',member_lname) as 'member' from member_cccb_lnk join member on
>>>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
>>>>"$cccb_id"
>>>>order by member";
>>>>>
>>>>output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>>>',member_lname) as 'member' from member_cccb_lnk join member on
>>>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
>>>>order by
>>>>memberError 1064
>>>>>
>>>>as you can see, "$cccb_id" is not in query string.
>>>>>
>>>>any help will be appreciated.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>Count your double quotes:
>>>>
>>>$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id"
>>>order by
>>>member";
>>>>
>>>So your $cccb_id isn't inside the quotes. You probably want to
>>>either
>>>remove those quotes so the variable is inserted into the string
>>>automatically or add .'s on both sides of $cccb_id.
>>>>
>>
>Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
>Removing the double quotes around it will solve your problem.
>>
>If it is not numeric, then you need single quotes around it, not
>double.
>>
Nope but thanks anyway.
>
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member;";
>
query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = ''
order by
member;
>

(Top posting fixed)

Whoops - I missed one important thing. It looks like $cccb_id is
empty.

Try echoing this to the screen before you build your select statement.

P.S. Please don't top post. Thanks.

variable is not empty. As explained earlier this same sql script runs
fine if placed inside the php program. It is just when it is located
within the require "db.inc" file that the variable substitution
does not
> work.

Appreciate your top post request, but refuse to join the flat earth
society.

(Top posting fixed - again)

As I said - did you actually try to echo the variable to the screen to
see what's in it?

And if you don't follow normal usenet conventions, don't expect to get
a lot of help from this newsgroup. You're the one asking for help.
You should follow the established conventions.

So please don't top post. Or don't expect much for answers.
Jerry,

Read posts and reply or don't. That is your decision.

P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!

Have a nice day!

Top posting fixed - AGAIN!

No, but top posting in a group which uses bottom posting as a
convention, then refusing to change when politely asked, shows the
ultimate level of arrogance.

Considerate people follow the conventions of the culture (including
newsgroups) in which they participate. Only losers and assholes refuse
to do so and insist others follow whatever conventions THEY want to observe.

Which are you?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 19 '07 #17
Message-ID: <jO******************************@comcast.comfro m Jerry
Stuckle contained the following:
P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!

Have a nice day!
Top posting fixed - AGAIN!

No, but top posting in a group which uses bottom posting as a
convention, then refusing to change when politely asked, shows the
ultimate level of arrogance.

Considerate people follow the conventions of the culture (including
newsgroups) in which they participate.
Isn't snipping irrelevant content also a convention?

gd&rlf

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jan 19 '07 #18
user <so*****@somewhere.orgwrote:
>
Jerry,

Read posts and reply or don't. That is your decision.

P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!
At the risk of beating a dead horse, I'd like to explore what you've said
here.

Most people top-post because Microsoft chose to write Outlook and Outlook
Express with blatent (and perhaps intentional) disregard for the
established patterns. Those people top-post because they are use the
defaults without thinking and without knowing any better.

You, on the other hand, seem to be making the argumeent that top-posting is
somehow superior to bottom-posting. I've not heard that argument before,
and I'd like to hear your reasons. Clearly, saying "I do it therefore it
must be better" is nonsense, so you must have something better.

Personally, I don't think it makes a bit of difference. Most people quote
way, way, WAY too much as it is; thanks to threading newsreaders, all I
need is the briefest reminder of what we were talking about for context.
When you cut quoting to a minimum, the top/bottom thing becomes irrelevant.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jan 21 '07 #19
Rik
Tim Roberts wrote:
Most people top-post because Microsoft chose to write Outlook and
Outlook Express with blatent (and perhaps intentional) disregard for
the established patterns. Those people top-post because they are use
the defaults without thinking and without knowing any better.
Hurray for OE-Quotefix...
Personally, I don't think it makes a bit of difference. Most people
quote way, way, WAY too much as it is; thanks to threading
newsreaders, all I need is the briefest reminder of what we were
talking about for context. When you cut quoting to a minimum, the
top/bottom thing becomes irrelevant.
Quoting should always be at the top. And the reason to quote is something
dear to me: in usenet, on thousands of servers, not every post get's
through, and sometimes not even in the right order. So the quote is there
to inform people who might not see the previous what was there, or at least
in which direction this particular (sub) thread goes. Without the quote, I
have no idea what the original post/topic/question was, which is highly
frustrating... and unfortunately with a somewhat buggy newsserver atm not a
very rare occurance for me.
--
Rik Wasmus
Jan 21 '07 #20
..oO(Rik)
>Tim Roberts wrote:
>Personally, I don't think it makes a bit of difference. Most people
quote way, way, WAY too much as it is; thanks to threading
newsreaders, all I need is the briefest reminder of what we were
talking about for context. When you cut quoting to a minimum, the
top/bottom thing becomes irrelevant.

Quoting should always be at the top. And the reason to quote is something
dear to me: in usenet, on thousands of servers, not every post get's
through, and sometimes not even in the right order. So the quote is there
to inform people who might not see the previous what was there, or at least
in which direction this particular (sub) thread goes.
Yep, that's what a quote is for. But it's still no reason for a full
quote of a hundred lines or even more. Such a full quote at the top with
a short answer below it is even more annoying than a full bottom quote.
>Without the quote, I
have no idea what the original post/topic/question was, which is highly
frustrating... and unfortunately with a somewhat buggy newsserver atm not a
very rare occurance for me.
Tim didn't suggest to quote nothing. The key is to quote _reasonably_ -
not too less, not too much. Many people here calling for bottom quotes
seem to forget the latter.

Micha
Jan 22 '07 #21
Wikipedia.org/wiki/Arrogance

Often people who are arrogant are not aware of their own behavior or
don't want to recognize they are arrogant. A person can be arrogant but
not show it externally to others due to their thoughts, actions and
emotions.

A strongly arrogant person will usually try to downplay other people's
achievements or ideas in order to make themselves appear better.
Arrogant people will even ignore or downplay good ideas from others, as
they cannot accept that others might have better ideas than themselves..
This makes reasonable communication difficult and arguments impossible
to resolve fairly as the arrogant person will not accept the other
person's point of view, no matter how logical/intuitive or correct it
is, because the arrogant person is really having an emotional argument
about their own arrogance.

Do you go along with all other cultural 'conventions'? I don't think so.

Maybe if you spend as much time correcting this problem as you do
annoying others with 'your' and a 'few' other dogma disciples it would help.
Jerry Stuckle wrote:
user wrote:
>Jerry Stuckle wrote:
>>user wrote:

Jerry Stuckle wrote:

user wrote:
>
>Jerry Stuckle wrote:
>>
>>user wrote:
>>>
>>>Tried those already.....
>>>>
>>>'$cccb_id' cccb.cccb_id = ('') order by memberError 1064
>>>.'$cccb_id'. gets cccb.cccb_id = (.''.) order by memberError 1064
>>>and $cccb_id and [cccb_id] and ........
>>>>
>>>>
>>>>
>>>ZeldorBlat wrote:
>>>>
>>>>user wrote:
>>>>>
>>>>>Have require file with several query stings in it.
>>>>>>
>>>>>Depending on user input one of strings is selected. Everything
>>>>>going
>>>>>along smoothly until I wanted to also input a variable in
>>>>>string. If I
>>>>>put string in program works ok, but, if I use string from
>>>>>require file I
>>>>>can not seem to insert string.
>>>>>>
>>>>>$cccb_id is sting..... to be inserted into $query4 and changes
>>>>>depending
>>>>>on user input.
>>>>>>
>>>>>$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>>>>',member_lname) as 'member' from member_cccb_lnk join member on
>>>>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>>>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
>>>>>"$cccb_id"
>>>>>order by member";
>>>>>>
>>>>>output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
>>>>>',member_lname) as 'member' from member_cccb_lnk join member on
>>>>>(member.member_no = member_cccb_lnk.member_no) join cccb on
>>>>>member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
>>>>>order by
>>>>>memberError 1064
>>>>>>
>>>>>as you can see, "$cccb_id" is not in query string.
>>>>>>
>>>>>any help will be appreciated.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Count your double quotes:
>>>>>
>>>>$query4 = "select cccb.cccb ... and cccb.cccb_id = "$cccb_id"
>>>>order by
>>>>member";
>>>>>
>>>>So your $cccb_id isn't inside the quotes. You probably want to
>>>>either
>>>>remove those quotes so the variable is inserted into the string
>>>>automatically or add .'s on both sides of $cccb_id.
>>>>>
>>>
>>Is $cccb_id a numeric value? If so, it shouldn't be in quotes.
>>Removing the double quotes around it will solve your problem.
>>>
>>If it is not numeric, then you need single quotes around it, not
>>double.
>>>
Nope but thanks anyway.
>
$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id =
'$cccb_id'
order by member;";
>
query4 is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member'
from member_cccb_lnk join member on (member.member_no =
member_cccb_lnk.member_no) join cccb
on member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = ''
order by
member;
>
>
(Top posting fixed)
>
Whoops - I missed one important thing. It looks like $cccb_id is
empty.
>
Try echoing this to the screen before you build your select statement.
>
P.S. Please don't top post. Thanks.
>
>
>
variable is not empty. As explained earlier this same sql script runs
fine if placed inside the php program. It is just when it is located
within the require "db.inc" file that the variable substitution
does not
work.
>
Appreciate your top post request, but refuse to join the flat earth
society.
>

(Top posting fixed - again)

As I said - did you actually try to echo the variable to the screen
to see what's in it?

And if you don't follow normal usenet conventions, don't expect to
get a lot of help from this newsgroup. You're the one asking for
help. You should follow the established conventions.

So please don't top post. Or don't expect much for answers.
Jerry,
>
Read posts and reply or don't. That is your decision.
>
P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!
>
Have a nice day!
>
>
Top posting fixed - AGAIN!

No, but top posting in a group which uses bottom posting as a
convention, then refusing to change when politely asked, shows the
ultimate level of arrogance.

Considerate people follow the conventions of the culture (including
newsgroups) in which they participate. Only losers and assholes refuse
to do so and insist others follow whatever conventions THEY want to
observe.

Which are you?
Jan 23 '07 #22
Well thank you.

I 'stopped' bottom posting quit some time ago. Reason, I took a lot more
to read bottom posts than top posts. As you state even at it's best
bottom posts suffer from people 'not' cutting.

I have never understood the bottom post argument of 'that's the way is
has always been' or 'that's the way it is'. Many bottom posting groups
have changed and with all the time some people spend trying to enforce
'their' ideas on others they could spend said time fixing the problem.

It really seems 'flat earth' mentality without being arrogant.

Tim Roberts wrote:
user <so*****@somewhere.orgwrote:
>>Jerry,

Read posts and reply or don't. That is your decision.

P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!


At the risk of beating a dead horse, I'd like to explore what you've said
here.

Most people top-post because Microsoft chose to write Outlook and Outlook
Express with blatent (and perhaps intentional) disregard for the
established patterns. Those people top-post because they are use the
defaults without thinking and without knowing any better.

You, on the other hand, seem to be making the argumeent that top-posting is
somehow superior to bottom-posting. I've not heard that argument before,
and I'd like to hear your reasons. Clearly, saying "I do it therefore it
must be better" is nonsense, so you must have something better.

Personally, I don't think it makes a bit of difference. Most people quote
way, way, WAY too much as it is; thanks to threading newsreaders, all I
need is the briefest reminder of what we were talking about for context.
When you cut quoting to a minimum, the top/bottom thing becomes irrelevant.
Jan 23 '07 #23
Message-ID: <Uf*********************@bgtnsc04-news.ops.worldnet.att.net>
from user contained the following:
>I 'stopped' bottom posting quit some time ago. Reason, I took a lot more
to read bottom posts than top posts. As you state even at it's best
bottom posts suffer from people 'not' cutting.
*plonk*

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jan 23 '07 #24
Norman,

Thanks for the try. I had tried this and many many other syntax's. I
think most people are forgetting what I feel is the main issue.

The file with the query in it is added to the php file with a require
function. It is not actually in the php file. As previously stated when
the query is actually in the php it works fine. However, when the query
is in the external file and brought in with the 'require' function the
variable substitution does not work.

Norman Peelman wrote:
user wrote:
>Have require file with several query stings in it.

Depending on user input one of strings is selected. Everything going
along smoothly until I wanted to also input a variable in string. If I
put string in program works ok, but, if I use string from require file
I can not seem to insert string.

$cccb_id is sting..... to be inserted into $query4 and changes
depending on user input.

$query4 = "select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = "$cccb_id"
order by member";

output is: select cccb.cccb_name as 'cccb', CONCAT(member_fname,'
',member_lname) as 'member' from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = order by
memberError 1064

as you can see, "$cccb_id" is not in query string.

any help will be appreciated.


Try:

$query4 = "select cccb.cccb_name as cccb, CONCAT(member_fname,'
',member_lname) as member from member_cccb_lnk join member on
(member.member_no = member_cccb_lnk.member_no) join cccb on
member_cccb_lnk.cccb_id = cccb.cccb_id and cccb.cccb_id = '$cccb_id'
order by member";

If $cccb_id has a value in it it will show up in the output. Notice I
removed the single quotes from around cccb and member as they are not
needed. Use backticks (`) if you must. Always remember, to include
variables whithin strings the entire string must be enclosed in double
quotes or the variables won't get parsed.

Norm
Jan 23 '07 #25
Read it. You've got to be kidding.

David Gillen wrote:
user said:
>>I have never understood the bottom post argument of 'that's the way is
has always been' or 'that's the way it is'. Many bottom posting groups
have changed and with all the time some people spend trying to enforce
'their' ideas on others they could spend said time fixing the problem.

Well how about some decent arguments as to why you should bottom post.
http://www.caliburn.nl/topposting.html

D.
Jan 23 '07 #26
user wrote:
>
> Jerry,

Read posts and reply or don't. That is your decision.

P.S. For you and Inkster. THE EARTH IS NOT FLAT!!! REALLY!! Any you
saying it is does not make it so!

Have a nice day!

Top posting fixed - AGAIN!

No, but top posting in a group which uses bottom posting as a
convention, then refusing to change when politely asked, shows the
ultimate level of arrogance.

Considerate people follow the conventions of the culture (including
newsgroups) in which they participate. Only losers and assholes
refuse to do so and insist others follow whatever conventions THEY
want to observe.

Which are you?
Wikipedia.org/wiki/Arrogance

Often people who are arrogant are not aware of their own behavior or
don't want to recognize they are arrogant. A person can be arrogant but
not show it externally to others due to their thoughts, actions and
emotions.

A strongly arrogant person will usually try to downplay other people's
achievements or ideas in order to make themselves appear better.
Arrogant people will even ignore or downplay good ideas from others,
as they cannot accept that others might have better ideas than
themselves.. This makes reasonable communication difficult and
arguments impossible to resolve fairly as the arrogant person will not
accept the other person's point of view, no matter how
logical/intuitive or correct it is, because the arrogant person is
really having an emotional argument about their own arrogance.

Do you go along with all other cultural 'conventions'? I don't think
so.

Maybe if you spend as much time correcting this problem as you do
annoying others with 'your' and a 'few' other dogma disciples it would
help.
Again - top posting fixed

Yes, that describes you to a tee.

And yes, I generally go along with cultural conventions when I am in
that culture. "When in Rome...".

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 23 '07 #27
user wrote:
I 'stopped' bottom posting quit some time ago. Reason, I took a lot more
to read bottom posts than top posts. As you state even at it's best
bottom posts suffer from people 'not' cutting.
People who don't snip their quotes properly are arguably worse than top
posters.

With unsnipped bottom posting, you have to wade through tonnes of useless
drivel to get to the point. With unsnipped top posting, you don't have to
wade through all that drivel, but it's still there at the end of the
message, wasting hundreds of megabytes[1] per post!

Conservative quoting, adding your comments interspersed within the quoted
material, and trimming out any parts of the original message to which
you're not directly replying will produce a far more legible response than
any other method. It will save your readers unnecessarily paging through
great swathes of quoted material to find a few lines of original material
beneath.

Of course, it's a little more effort than mindlessly starting to type
wherever your news client plonks the cursor (be that at the top or the
bottom), but that extra effort *saves* effort for the dozens, perhaps
hundreds, thousands, or in the case of a few special messages, millions[2]
of people who are going to read your article.

This is the way I've always posted, and I can't recall ever having
received any complaints about my style -- and I have posted to groups
where both top and bottom posting is the norm.

But, in the end, to each their own. "user", you have free will[3], and
although I hope you give my arguments presented above some thought, you
are perfectly free to continue posting in your current manner. I too have
free will, and am free to consider you an obnoxious twerp if you carry on
top-posting, and may well choose not to answer the questions raised by
said twerp in the future.

Kindest regards,

____
1. Say one post, with 100 lines at about 50 characters per line is
about 5 kB. Now distribute that over a thousand news servers and
you've got 5 MB. How many usenet servers are there? In my brief
research, estimates seem to be around the 100,000 mark, so that's
500 MB of wasted space.
2. I'm sure there must be at least a million people who have since
read Linus Torvalds' announcement of the first release of Linux.
3. Many philosophers and scientists are beginning to dispute the
existance of free will. Personally, I'm 100% with them, having
always considered free will to be a paradox in a universe where
future events are dictated by the laws of causality. Nevertheless,
whether or not free will is simply an illusion, the "coping
strategy" of an intelligent mind in a dertiministic universe, one
must live one's life, *as if* one has free will.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jan 23 '07 #28

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott | last post by:
I have an XML Document in a format like: <Variable name="Bob">ABCDEFG</Variable> <Variable name="Steve">QWERTYUI</Variable> <Variable name="John">POIUYTR</Variable> <Variable...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
3
by: markaelkins | last post by:
Hi. I am trying to enter a variable in the treenodesrc of a treenode. I am basically trying to send an ID variable into sql to return different records. I've searched everywhere and cannot find the...
15
by: Thomas Scheiderich | last post by:
I thought I read that the case for the variable names is important. For example Dim Wheel As Integer Wheel here is a different variable from WHEEL. Is this correct?
4
by: JohnR | last post by:
Hi all, I'm finally sick and tired of manually generating get/set properties for each private variable in a class so I'm trying to create a macro to do it. I'm stuck because I can't figure out...
4
by: thomasp | last post by:
In the code below I have a function that tests if a file exists. It takes a variable named strFileName, simple enough. My question is, is there a way to pass it a variable with another name as...
23
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
6
by: Jody Gelowitz | last post by:
I have run into an issue with variable scope within an XSLT document that is translated in VS.NET 2.0. Under VS.NET 1.1 (XslTransform), this code works fine. However, when using VS.NET 2.0...
13
by: Justcallmedrago | last post by:
How would you declare and assign a variable inside a function THAT HAS THE NAME OF A PARAMETER YOU PASSED example: when you call createvariable("myvariable") it will declare the variable...
2
by: Looch | last post by:
All, I'm trying to output but I can only get (brackets for clarity) when using the code below. How can I "break" into the query variable in the InsertName method to add the name parameter to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.