By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

php variable in sql string

P: n/a
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
Share this Question
Share on Google+
27 Replies


P: n/a

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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
..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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.