Re: [PHP] Struggling with MySQL query

2011-08-09 Thread David Green
Thank you all for the various suggestions. It now works with this: $find = strip_tags($find); $find = trim($find); $data = mysql_query("SELECT * FROM news_items WHERE headline LIKE '%$find%'"); Another "newb" question: does strip_tags() help at all in preventing SQL injection attacks? Kind reg

[PHP] Struggling with MySQL query

2011-08-09 Thread David Green
Hi I have a simple from which uses the post method to get to my page script results.php in results.php I have $find=$_POST["find"]; //this works perfectly, echo $find gives me the search term as entered I then connect to mysql and select the db successfully. After that, I have the following:

[PHP] Re: Unanticipated characters returned from multidimensional array

2011-08-06 Thread David Green
On Sat, Aug 6, 2011 at 4:44 PM, Shawn McKenzie wrote: > > I haven't look through it long enough to find out about the characters, > but try this: > > foreach($tableNews as $headline => $text){ > echo ""; >echo $text['text']; >echo ""; >echo $text['user']['name']; >echo ""; > }

[PHP] Unanticipated characters returned from multidimensional array

2011-08-06 Thread David Green
Hullo list Like so many of those asking questions I'm new to PHP (in fact, new to programming altogether - I'm a medical doctor in my "other" life). Some of what I show below is very likely redundant, so any pointers (beyond the question asked) would be most welcome I'm really struggling in the

Re: [PHP] php editor

2005-01-14 Thread David Green
riting php code. I was considering of using some kind of php editor program to help with the syntax. Know any goog ones? Thanks -Will -- ------ David Green Information Centre, Central Science Laboratory Sand Hutton, York, YO41 1LZ Phone: +44 (0)1904 4

[PHP] Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] strange in MySQL Query.

2005-01-14 Thread David Green
Why not ask a MySQL mailing list? [snip] .. is this mysql bug ? [/snip] -- -- David Green Information Centre, Central Science Laboratory Sand Hutton, York, YO41 1LZ Phone: +44 (0)1904 462388 (GTN: 5129 2388) Fax:+44 (0)1904 462111 E-Mail

Re: [PHP] Preventing execution without inclusion

2005-01-14 Thread David Green
be in the beginning of all the class files, at the top, before any other code was to be executed. As of yet, it has eluded me... -- ------ David Green Information Centre, Central Science Laboratory Sand Hutton, York, YO41 1LZ Phone: +44 (0)1904 46

Re: [PHP] email processing

2004-12-13 Thread David Green
know how to process the email that coming to our mailbox and process the message inside with PHP. can someone recommend me a PHP class that has been created for handling this task ? -- -- David Green Information Centre, Central Science Labo

[PHP] Showing absolute path in $_FILES

2003-12-04 Thread David Green
Quick file question. I want to have a user locate a file, and have the absolute path be saved as a variable. I have a form of type "file". In the form tag, I have enctype="multipart/form-data". On the target page, I call it by using $file = $_FILES['file']['name']. When i navigate to the file