[PHP-DB] [4.3.3] How to buildi with SQLite support ?
I looked the the configure --help but didn't see sqlite? Or did I just miss it? How can I build the module for sqlite. David -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Generating readio buttons
Howdy -- How do I dynamically generate the value for radio buttons off the DB (MySQL) backend? Here's some code that almost works TIA, David - Almost works ?php $header = mysql_query (SELECT * FROM chart ORDER BY acct ); if ($row = mysql_fetch_array($header)) { do { print(tr bgcolor=\white\ ); print 'td width=5input type=radio name=gl_acct value=acct[]/td'; print(td width=\12\); print $row[acct]; print /tdtd width=\12\; print $row[cat]; print /tdtd ; print $row[descript]; print(/td/tr\n); } while($row = mysql_fetch_array($header)); } else {print Sorry, no records were found!;} ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: LIKE statement
Chris Barnes wrote: Hi, I've got a dilly of a problem. I'm probably doing something wrong but I don't know what. I'm trying to use the LIKE statement in a query where more than one word is used in with LIKE..e.g. select count(distinct itemid) from business where name or description like 'word1 word2 word3%' Chris -- The answer depends on what database you using? MySQL has a IN operator, so you might try: SELECT * from table WHERE name IN ('value1','value2','value3) OR WHERE description IN ('value1','value2','value3) Your might want to cross post to MySQL list. HTH, David The problem I'm having is probably obvious to you but I don't know why this returns no matches but if i specify only 1 word in the LIKE statement then it returns a match. Am i not able to specify more than 1 word with LIKE or am I just doing it wrong? It has been designed to take input from a web form by the variable $search_string and then the query string is constructed from that e.g. $query = select count(distinct itemid) from business where name or description like' . $search_string . '; Any help or suggestions greatly appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Generating readio buttons
Peter Beckman wrote: Peter, Thanks for your prompt reply. Gonna need some additional information, such as: 1. The first three rows your query returns 2. The expected output 3. The actual problem and/or error. What I'm trying todo is build a radio box form for the selection of ledger accounts for a account app. ( http://mustardandrelish.com/ledger) Query returns (from HTML table): input type=radio name=gl_acct value=acct[] input type=radio name=gl_acct value=acct[] input type=radio name=gl_acct value=acct[] Expected results might be: input type=radio name=gl_acct value=1000 input type=radio name=gl_acct value=2000 input type=radio name=gl_acct value=3000 And then gl_acct will be passed to the G/L entry screen (sticky forms?) TIA, David Peter On Sun, 3 Nov 2002, David Jackson wrote: Howdy -- How do I dynamically generate the value for radio buttons off the DB (MySQL) backend? Here's some code that almost works TIA, David - Almost works ?php $header = mysql_query (SELECT * FROM chart ORDER BY acct ); if ($row = mysql_fetch_array($header)) { do { print(tr bgcolor=\white\ ); print 'td width=5input type=radio name=gl_acct value=acct[]/td'; print(td width=\12\); print $row[acct]; print /tdtd width=\12\; print $row[cat]; print /tdtd ; print $row[descript]; print(/td/tr\n); } while($row = mysql_fetch_array($header)); } else {print Sorry, no records were found!;} ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] LIKE statement or IN statement?
Chris Barnes wrote: Yeah I really need to search for multiple words. Can anyone confirm if the IN statement will work for me in this situation? Chris -- Why not just try it you self and let's us know. Also check to MySQL doc at http://mysql.org David On Mon, 2002-11-04 at 09:31, [EMAIL PROTECTED] wrote: if you want to search for multiple words, u have to use multiple like operators: select count(distinct itemid) from business where name like 'word1' or name like 'word2' or name like 'word3'; or the IN statement with wildcards: select count(distinct itemid) from business where name IN ('%word1%','%word2%','%word3%'); -- im not too sure of this, would the experts please shed some more light on this one if its correct? Amit On 4 Nov 2002, Chris Barnes wrote: Hi, I've got a dilly of a problem. I'm probably doing something wrong but I don't know what. I'm trying to use the LIKE statement in a query where more than one word is used in with LIKE..e.g. select count(distinct itemid) from business where name or description like 'word1 word2 word3%' The problem I'm having is probably obvious to you but I don't know why this returns no matches but if i specify only 1 word in the LIKE statement then it returns a match. Am i not able to specify more than 1 word with LIKE or am I just doing it wrong? It has been designed to take input from a web form by the variable $search_string and then the query string is constructed from that e.g. $query = select count(distinct itemid) from business where name or description like' . $search_string . '; Any help or suggestions greatly appreciated. --- Peter BeckmanSystems Engineer, Fairfax Cable Access Corporation [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Generating readio buttons
Peter Beckman wrote: Here's your problem: acct[] doesn't equal anything. $acct[4] might. So: echo input type='radio' name='gl_acct' value='{$acct[4]}'; Peter -- Thanks again for you help. I wonder if it's not a quoting issue on my part? How would I use the $row[column_name], in the above statement? Since it not a $_POST[] filed? Thanks in advance, David -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Generating readio buttons
OK, this works but there has to be a pretty way? David - Works - html headtitleOperation Sticky Bun/title/head body h3 align=centerOperation Sticky Bun /h3 ?php require('connect.php'); ? ?php print 'form action=hello.php method=post'; $header = mysql_query (SELECT * FROM chart ORDER BY acct ); if ($row = mysql_fetch_array($header)) { do { print 'input type=radio name=ledger_acct value='; print $row[acct];print ''; print $row[descript];print 'br'; } while($row = mysql_fetch_array($header)); } else {print Sorry, no records were found!;} print '/form'; ? /body /html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Resolved: Inserting current date(MySQL)?
John, Jeffery, Alex and Jason -- Thanks for you response. As you all suggested it was as simple as CURDATE(). without any quotes or backticks. Thanks again, David -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php