[PHP-DB] PLS Advise, Highlighted Text from a Query

2003-06-18 Thread nabil
Dear all, 1- I have a form with an input text : keyword 2- the field address is in my MySQL as TEXT field. 3- I select * from db where address like '%keyword%' 4- I want when echo the return $row[address] to highlight the entered keyword (that the user has entered in the search form) in the

[PHP-DB] mktime to subtract minutes (was Time without seconds)

2003-06-18 Thread Lisi
I realized I need to do some processing on the time after it's retrieved, so I decided to retrieve hours and minutes separately and then subtract the necessary time with PHP. Each city has sunset times for each day stored in the database, in a datetime field. I retrieve all cities and times for

Re: [PHP-DB] time without seconds

2003-06-18 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... In general, is it better to have MySQL select less using TIME_FORMAT than=20 to have PHP crop the info? -Lisi The general rule of thumb seems to be: if mysql can do it, use mysql else use php. -- Quod subigo farinam $email =~

[PHP-DB] Re: PLS Advise, Highlighted Text from a Query

2003-06-18 Thread Cristian MARIN
Yes it is posible using the preg_replace substituing the text with /bthe text/b or to what ever you want. If you are not advanced in php you could do it with substr_replace() function. The first solution is more dificult to be used but you have the advantage you can search for each word used in

[PHP-DB] RE: [PHP-WIN] Password generator

2003-06-18 Thread Svensson, B.A.T. (HKG)
Create a string which is six char long, (for instance shop the head and tail of the first string if you are not able to generate a six char string) If you chop an 8 char string and MUST have the special chars in the string then check that the chopped char's is not a memember of the special

[PHP-DB] Selecting unique values from a db

2003-06-18 Thread mike karthauser
Being thick today: How do I select unique values from a table? Eg I have a image upload script that writes the name of the file to a db when it uploads. As we may need to upload the image several times, my db is full up with several rows with same titles.. Eg: img db id | title |

Re: [PHP-DB] Selecting unique values from a db

2003-06-18 Thread John W. Holmes
mike karthauser wrote: Being thick today: How do I select unique values from a table? Eg I have a image upload script that writes the name of the file to a db when it uploads. As we may need to upload the image several times, my db is full up with several rows with same titles.. Eg: img db id

Re: [PHP-DB] Selecting unique values from a db

2003-06-18 Thread mike karthauser
on 18/6/03 12:20 pm, John W. Holmes at [EMAIL PROTECTED] wrote: Not really a PHP question... This is a php db list though. SELECT DISTINCT title FROM ... Thanks for this. -- Mike Karthauser Managing Director - Brightstorm Ltd Email[EMAIL PROTECTED] Web

FW: [PHP-DB] FW: Call to undefined function: mysql_connect

2003-06-18 Thread Idan Dolev
HI, I am using redhat 9 2.4.20-9 kernel and the following rpm's MySQL-devel-4.0.13-0 MySQL-server-4.0.13-0 MySQL-client-4.0.13-0 MySQL-shared-3.23.51-1 php-mysql-4.2.2-17 in my phpinfo file I see --with-mysql I get the following error when I try to access my php page: Fatal error:

[PHP-DB] Re: PLS Advise, Highlighted Text from a Query

2003-06-18 Thread nabil
Yes please that is what i want.. if it possible to give em the code.. thanks in advance for you and for George Pitcher Cristian Marin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes it is posible using the preg_replace substituing the text with /bthe text/b or to what ever you

Re: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query

2003-06-18 Thread Becoming Digital
Oops! I sent this to the wrong list last night. This is what happens when we answer emails @ 4:18 AM... 4- I want when echo the return $row[address] to highlight the entered keyword (that the user has entered in the search form) in the output with a different font backcolor or by just

Re: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query

2003-06-18 Thread nabil
Edward , what about the percentage how much accurate the result returned?? Becoming Digital [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Oops! I sent this to the wrong list last night. This is what happens when we answer emails @ 4:18 AM... 4- I want when echo the return

Re: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query

2003-06-18 Thread Becoming Digital
what about the percentage how much accurate the result returned?? Let's see... Since you're on the list, I'll give you a discounted rate of $80.00/hr. I accept Credit Cards, Money Orders, PayPal, and cash. Seriously, you can't expect us to do your work for you. I know quite little about

Re: [PHP-DB] Creating/Populating DB

2003-06-18 Thread colbey
This should be as simple as a PHP script that opens a connection to the destination server (with rights to do all actions you mentioned).. Opens a text file with all the SQL commands you want to issue, and starts firing them off at the server 1 by 1... Once you create the database, you need to

Re: [PHP-DB] Creating/Populating DB

2003-06-18 Thread Gerard Samuel
[EMAIL PROTECTED] wrote: This should be as simple as a PHP script that opens a connection to the destination server (with rights to do all actions you mentioned).. Opens a text file with all the SQL commands you want to issue, and starts firing them off at the server 1 by 1... Once you create the

[PHP-DB] Re: Get last id in postgresql

2003-06-18 Thread chris
On Mon, 16 Jun 2003 21:13:14 -0500, Norma Ramirez - Tecnosoft [EMAIL PROTECTED] wrote: Hi all, Im starting with posgresql and i trying to use pg_last_oid to get the last id in a insert query, but this function returns me a big number like 21318 and bigger, but the table just have 3 or 4

[PHP-DB] order by an average in another table (basically a top 10 list)

2003-06-18 Thread chris
I've done a google search, but most of the results are for the part I've already figured out. People that have the top 10 sorting usually want money for their system (one wanted an absurd $500). I'm working on a database application where users vote on how much they like a particular picture.

Re: [PHP-DB] order by an average in another table (basically a top 10 list)

2003-06-18 Thread Metin Kale
Just a shot in the dark.. it may be wrong, but try it out.. SELECT avg(rating) AS avgrating FROM ratings WHERE parent_id = '$id' ORDER BY avgrating DESC LIMIT 10 try that out.. should work. metin At 04:06 PM 6/18/2003 -0400, chris wrote: I've done a google search, but most of the results are

[PHP-DB] Re: order by an average in another table (basically a top 10 list)

2003-06-18 Thread chris
On Wed, 18 Jun 2003 16:06:23 -0400, Chris [EMAIL PROTECTED] wrote: I've done a google search, but most of the results are for the part I've already figured out. People that have the top 10 sorting usually want money for their system (one wanted an absurd $500). I'm working on a database

Re: [PHP-DB] Re: PLS Advise, Highlighted Text from a Query

2003-06-18 Thread Mikon Dosogne
[...] what about the percentage how much accurate the result returned?? I'm not sure what kind of keywords or text you're searching, but here's the algorithm i used a while back, for plain-text search: given: $query $text /* curve() maps values between 0 and 1 to.. a curve: 0% - 0% 25% -