Reply to Re: php variable in sql string

Your name:

Reply:


Posted by user on 01/23/07 15:45

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?
>

[Back to original message]


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

Copyright © 2005-2006 Powered by Custom PHP Programming

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