doing SELECTS and keeping the array intact with php

2005-01-03 Thread julian haffegee
Hi all, this has been bugging me for some time now. I want to do a mysql select then using php while ($a_row = mysql_fetch_array($result)) { do something to get a small portion of the data } and that works fine. Then later I need to access $result as a complete array again. Is there a way I can

filter input

2003-01-14 Thread julian haffegee
Hi all, I want to insert some text into my database, but I'm worried about bad data - metacharacters etc. So I need to filter the input and remove bad characters. Which characters should I remove? What is bad for mysql? does anyone know a good subroutine (or webpage telling me all about it) for

Re: select statements

2002-09-06 Thread julian haffegee
Jules - Original Message - From: Jed Verity [EMAIL PROTECTED] To: julian haffegee [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 06, 2002 3:42 AM Subject: Re: select statements Hello, Jules, You can use the value in (a,b,c) format. If necessary, implode your array and do

select statements

2002-09-05 Thread julian haffegee
Hi all, I have a database of names and email addresses, that I want to email. $result = mysql_query(SELECT emailAddress FROM subscribers_html WHERE mailingGroup='$toText'); The select statement needs to return a row when mailingGroup='$toText', but $toText is an array. How should I write this

order by date

2002-07-29 Thread julian haffegee
This must be a regularly appearing problem, which is why i'm surprised I can't find a webpage on it.. I have $result = mysql_query(SELECT title, url, description, author, date_format(date,'%D %M %Y') AS date FROM documents_tbl, url_tbl WHERE documents_tbl.title_id = url_tbl.url_id ORDER BY

pattern matching (in text field)

2002-03-24 Thread julian haffegee
Hi all, I currently have $result = mysql_query (SELECT title_id, title FROM documents_tbl, url_tbl WHERE (documents_tbl.title_id = url_tbl.url_id) AND keywords LIKE '%$temp%' AND title_id != '$myrow[title_id]'); this works to an extent, but 'keywords' is a text field and if $temp is for

Re: site search

2002-03-12 Thread julian haffegee
Thanks Kim and Georg, but I want to do this myself! Ok it may be hard, but i'm confident I have taught myself an awful lot by having a 'difficult' project on the go so, bearing that in mind, can I re-ask my question! thanks again incidently I am making a SITE search, not a web search

site search

2002-03-11 Thread julian haffegee
Hi everyone, I want to build a MySQL site search. Can anyone help with my 'overview' I have written a perl programme to open each html file, cut out all the tags and create a hash of hashes each word is a key, then the secondary key is the filename, then the value is the number of occurances in

Re: date_format

2001-12-31 Thread julian haffegee
Thanks this works the difference was the 'AS datefield' what is this bit doing? I searched for AS (in the SELECT description in my book) but it does not mention it; though I have seen it in examples. I like to understand why I use the code I do... I looked at http://www.mysql.com/ but can

date_format

2001-12-30 Thread julian haffegee
Hello, i'm new to mysql, so please bear with me... My database has a field called datafield as datetime. I want to display just the date #1 this works but gives the full datetime $result = mysql_query (SELECT title, description, url, author, datefield FROM documents); #2 All I have read on