Reply to Re: Connecting to mysql with php

Your name:

Reply:


Posted by David Haynes on 02/14/06 23:14

Howard wrote:
> The script runs but there is no data. I get blank page.
>
> I copied the info for making a config.php file.
> So I guess I want to try using an include statment to call those files and
> see if
> that works.
> The scripts were copied right from the CD-ROM so I don't know why the
> echo statements don't seem to be doing anything.
>
> I put a require ('config.php') in the script. Still nothing shows up and no
> errors in
> the apache log.
>
> I have a feeling that it has to do with a configuration file with php or
> mysql.
>
> Thanks So far
>
> Howard
>
>
> "David Haynes" <david.haynes2@sympatico.ca> wrote in message
> news:LXnIf.23728$Hj6.11243@fe29.usenetserver.com...
>> Dave Mennenoh wrote:
>>>>> $query = select * from books where ".$searchtype." like
>>>>> '%".$searchterm."%'" ;
>>> Besides missing the leading quotation mark, you might like to know that
>>> you don't need to do concatenation like this using PHP - so you can
>>> simply do this:
>>>
>>> $query = select * from books where $searchtype like '%$searchterm%'" ;
>>>
>>> weird huh!
>>>
>> You also might like to use a format like:
>>
>> $query = <<<EOQ
>> SELECT *
>> FROM books
>> WHERE {$searchtype} LIKE '%{$searchterm}%'
>> EOQ;
>>
>> Which make the whole query a lot clearer to those used to SQL CLI
>> environments.
>>
>> -david-

Why not post snippets of your database connection code, your query
execution code and your html display code? It's very difficult to help
you with no examples...

-david-

[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

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