Re: [PHP] mysql question

2008-02-10 Thread Per Jessen
Nathan Nobbe wrote: what is $ret, an array? No, it's a mysql result object. no, its the contents of the first cell in the first record of the result set; from the doc on mysql_result(), http://www.php.net/manual/en/function.mysql-result.php which is what the function is using. Yep,

Re: [PHP] mysql question #2

2008-02-10 Thread Nathan Nobbe
On Feb 10, 2008 1:12 PM, nihilism machine [EMAIL PROTECTED] wrote: Ok, I read the php.net info. so with this function though: public function select_one($sql) { $this-last_query = $sql; $r = mysql_query($sql); if (!$r) {

Re: [PHP] mysql question #2

2008-02-10 Thread Zoltán Németh
2008. 02. 10, vasárnap keltezéssel 13.12-kor nihilism machine ezt írta: Ok, I read the php.net info. so with this function though: public function select_one($sql) { $this-last_query = $sql; $r = mysql_query($sql); if (!$r) {

Re: [PHP] Mysql session handler?

2008-01-29 Thread Chris
Mike Yrabedra wrote: Can anyone recommend a good php-mysql session handler class? http://www.php.net/manual/en/function.session-set-save-handler.php#79706 looks ok. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] mysql date question

2008-01-03 Thread Stut
Adam Williams wrote: select date_format('contract.length_start', '%m-%d-%Y') as length_start from contract where user_id = 1; This has nothing to do with PHP, but the first parameter to date_format should not be in quotes. -Stut -- http://stut.net/ -- PHP General Mailing List

RE: [PHP] mysql date question

2008-01-03 Thread Bastien Koert
no need for quotes select date_format(contract.length_start, '%m-%d-%Y') as length_start from contract where user_id = 1; bastien Date: Thu, 3 Jan 2008 08:30:55 -0600 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] mysql date question I have a field in mysql as

RE: [PHP] mysql date question

2008-01-03 Thread Jay Blanchard
[snip] I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format of -MM-DD. However, I need the output of my select statement to show it in MM-DD- format. I can

Re: [PHP] mysql date question

2008-01-03 Thread Silvio Porcellana
Uhm, a shot in the dark - try: select date_format(contract.length_start, '%m-%d-%Y') as length_start HTH, cheers! Silvio Adam Williams wrote: I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which

Re: [PHP] mysql date question

2008-01-03 Thread Richard Lynch
On Thu, January 3, 2008 8:30 am, Adam Williams wrote: I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format of -MM-DD. However, I need the output of my select

Re: [PHP] MySQL to blame? (was Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?)

2008-01-02 Thread Chris
M5 wrote: On 20-Dec-07, at 1:17 AM, Per Jessen wrote: René Fournier wrote: I'm really not sure what to try next. ps -aux shows MySQL as hogging the CPU, not PHP or Terminal: When this happens, do a 'SHOW PROCESSLIST' in mysql to see what it's doing. I have, and I can't see anything

Re: [PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams
nevermind, I see I had a mistake in my mysql statement, I should of been: select DATE_FORMAT(testdate, '%m\-%d\-%Y') as date_column from testtable; please disregard. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL and SVN

2007-10-25 Thread Emil Edeholt
Hi, Thanks for your answer. Are you sugesting - what I think is called - a multi-master replication? Since I would like to keep two sources in sync and want to be able to make changes on both servers. I know very little about replication. Maybe I'm making a bigger problem of this than it

Re: [PHP] MySQL connector installation/upgrade problems

2007-10-23 Thread Martin Marques
David Zentgraf escribió: Hi, I'm trying to upgrade a server running CentOS 3 to an up-to-date MySQL 5 installation + PHP4. I installed the MySQL 5 package, server and client, via RPMs and they work fine, the client tells me it's version 5.0.45. I went on to recompile PHP 4.4.7 --with-mysql,

Re: [PHP] MySQL connector installation/upgrade problems

2007-10-23 Thread David Christopher Zentgraf
On 23. Oct 2007, at 19:55, Martin Marques wrote: Wouldn't it be easier to upgrade to CentOS 5? We tried to explain that to our host, but their service *major expletive*, and other hosts in Tokyo ain't better either. :-( Chrs, Dav -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: PHP/MySQL CMS for Articles/Studies/Research Papers?

2007-10-19 Thread Colin Guthrie
Jason Paschal wrote: just wanted to know if any of you have seen anything geared for this sort of content, something professional-looking that doesn't come with a huge learning curve. it wouldn't have to be TOO fancy, i could probably make something, but didn't want to re-invent the

Re: [PHP] MySQL and SESSIONs

2007-10-08 Thread Philip Thompson
the crap out of everything - don't hit the DB unless you really need to. -Stut -- http://stut.net/ -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Friday, October 05, 2007 4:31 PM To: Stefano Esposito Cc: php-general@lists.php.net Subject: Re: [PHP] MySQL

Re: [PHP] MySQL and SESSIONs

2007-10-08 Thread mike
On 10/8/07, Philip Thompson [EMAIL PROTECTED] wrote: Hi. This may not be best practice, but I think it's great to use - especially since I can use multiple functions with the same database connection w/o having to send the db link/resource. Store the connection in the GLOBALS variable - this

Re: [PHP] mySQL Results To XML

2007-10-06 Thread mike
On 10/6/07, CK [EMAIL PROTECTED] wrote: Hi, Here's the mission, creating a movie DB, I need the results returned from mySQL in an XML format for use with the FLASH Professional DataGrid. Any tips on formating mySQL results would be grand. Here's the structure of the DB, if needed. you

RE: [PHP] mySQL Results To XML -- my xmltag() functions

2007-10-06 Thread Daevid Vincent
-Original Message- you could easily just print the xml manually. dvd titleIDfoo/titleID baretc/bar /dvd or, i believe mysql will return XML output but i'm not sure a PHP function exists to do that. no need to use fancy DOM functions, outputting XML is easy, parsing it

Re: [PHP] mySQL Results To XML -- my xmltag() functions

2007-10-06 Thread mike
On 10/6/07, Daevid Vincent [EMAIL PROTECTED] wrote: Here's the 'functions_xml.inc.php' file I use, it has served me well and handles I believe all tag cases, personally I'm a big fan of using the attributes as they're most easily parsed out in the PHP DOM functions: I made this at one point:

Re: [PHP] MySQL and SESSIONs

2007-10-05 Thread Stut
Stefano Esposito wrote: is it somehow possible to store the connection reference obtained from mysql_connect() (note the absence of the i) in a $_SESSION element? No. Why would you want to? You'd end up holding on to a database connection even when nothing is using it. If you want to

RE: [PHP] MySQL and SESSIONs

2007-10-05 Thread Vo, Lance
Stut What's good for multiple webservers? thanks -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Friday, October 05, 2007 4:31 PM To: Stefano Esposito Cc: php-general@lists.php.net Subject: Re: [PHP] MySQL and SESSIONs Stefano Esposito wrote: is it somehow possible

Re: [PHP] MySQL and SESSIONs

2007-10-05 Thread Stut
unless you really need to. -Stut -- http://stut.net/ -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Friday, October 05, 2007 4:31 PM To: Stefano Esposito Cc: php-general@lists.php.net Subject: Re: [PHP] MySQL and SESSIONs Stefano Esposito wrote: is it somehow possible

RE: [PHP] MySQL Identifying worst-performing codes

2007-10-04 Thread Jay Blanchard
[snip] There is  a tool call idera (SQL diagnostic manager). Basically it is a performance monitoring and diagnostics tool. It has a feature;  Identifying of worst-performing codes - Identifies performance bottlenecks such as the worst-performing stored procedures, long-running queries, most

Re: [PHP] MySQL upload problem (solved)

2007-09-13 Thread tedd
tedd wrote: I was thinking that I could ftp the sql file to the clients server and then run a php script on his server, something like: $sql = mysql -h$dbhost -u$dbuser -p$dbpass $dbname $filename; system($sql); But, that didn't work -- however -- using mysqldump did download the file. So,

Re: [PHP] MySQL upload problem

2007-09-11 Thread Stut
tedd wrote: I know that this is not a php question, but all of you are so smart I thought would ask anyway. I need to upload a 5 Meg sql file to a client's database. However, his site's phpMyAdmin shows a maximum file size limit of 2 Meg. Now, is this something that is controlled by his

Re: [PHP] MySQL upload problem

2007-09-11 Thread tedd
At 4:46 PM +0100 9/11/07, Stut wrote: tedd wrote: I know that this is not a php question, but all of you are so smart I thought would ask anyway. I need to upload a 5 Meg sql file to a client's database. However, his site's phpMyAdmin shows a maximum file size limit of 2 Meg. Now, is this

Re: [PHP] MySQL upload problem

2007-09-11 Thread Chris
tedd wrote: At 4:46 PM +0100 9/11/07, Stut wrote: tedd wrote: I know that this is not a php question, but all of you are so smart I thought would ask anyway. I need to upload a 5 Meg sql file to a client's database. However, his site's phpMyAdmin shows a maximum file size limit of 2 Meg.

Re: [PHP] MySQL upload problem

2007-09-11 Thread brian
tedd wrote: I was thinking that I could ftp the sql file to the clients server and then run a php script on his server, something like: $sql = mysql -h$dbhost -u$dbuser -p$dbpass $dbname $filename; system($sql); But, that didn't work -- however -- using mysqldump did download the file. So,

Re: [PHP] MySQL upload problem

2007-09-11 Thread Chris
tedd wrote: At 4:46 PM +0100 9/11/07, Stut wrote: tedd wrote: I know that this is not a php question, but all of you are so smart I thought would ask anyway. I need to upload a 5 Meg sql file to a client's database. However, his site's phpMyAdmin shows a maximum file size limit of 2 Meg.

Re: [PHP] MySQL upload problem

2007-09-11 Thread brian
Chris wrote: tedd wrote: I was thinking that I could ftp the sql file to the clients server and then run a php script on his server, something like: $sql = mysql -h$dbhost -u$dbuser -p$dbpass $dbname $filename; system($sql); But, that didn't work -- however -- using mysqldump did

Re: [PHP] MySQL upload problem

2007-09-11 Thread brian
brian wrote: tedd wrote: I was thinking that I could ftp the sql file to the clients server and then run a php script on his server, something like: $sql = mysql -h$dbhost -u$dbuser -p$dbpass $dbname $filename; system($sql); But, that didn't work -- however -- using mysqldump did download

Re: [PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread Janet Valade
brian wrote: I'm setting up a site and am having loads of problems with MySQL (which i don't use much, being a Postgres fan). The server is not controlled by myself and I'm waiting on a reply from the admin. In the meantime: PHP 4.3.9 Mysql 4.1.10a (server) 3.23.49 (client) The database has

Re: [PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread brian
Janet Valade wrote: First, if you are having an access denied problem, you will get a PHP error message. Perhaps you have errors turned off in your PHP script. Turn them on until you get it working. I forgot to mention that i've temporarily set: ini_set('track_errors', TRUE); // to access

Re: [PHP] MySQL, PHPMyAdmin, GRANT, headaches

2007-09-04 Thread tedd
At 3:00 PM -0400 9/4/07, brian wrote: I'm setting up a site and am having loads of problems with MySQL (which i don't use much, being a Postgres fan). The server is not controlled by myself and I'm waiting on a reply from the admin. In the meantime: PHP 4.3.9 Mysql 4.1.10a (server) 3.23.49

Re: [PHP] MySQL connect used to work PLUS errors not displaying

2007-08-24 Thread comex
On 8/24/07, Linux NG/Lists [EMAIL PROTECTED] wrote: b) Why does the error reporting NOT work as soon as I jam a $db new mysql call into the code? Because you disabled it with an '@'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL connect used to work PLUS errors not displaying

2007-08-24 Thread Linux NG/Lists
comex wrote: On 8/24/07, Linux NG/Lists [EMAIL PROTECTED] wrote: b) Why does the error reporting NOT work as soon as I jam a $db new mysql call into the code? Because you disabled it with an '@'. Well, I suppose I should say Doh! but even when I get rid of the @, I still get a blank

Re: [PHP] MySQL connect used to work PLUS errors not displaying

2007-08-24 Thread Jim Lucas
Linux NG/Lists wrote: ?php error_reporting(E_ALL); ini_set('display_errors','On'); @ $db=new mysqli('localhost','whil','secret','test'); get rid of the @, it will squelch your error output if (mysqli_connect_errno()) {echo 'Error ­ could not connect to database.'; exit; } ? put something at

Re: [PHP] MySQL connect used to work PLUS errors not displaying

2007-08-24 Thread Linux NG/Lists
Well, I suppose I should say Doh! but even when I get rid of the @, I still get a blank page - no errors, and no database, either! A followup - I'm taking this over to PHP-DB since it's now database-centric, I think. This still fails: $db = new mysqli( But this works $conn =

[PHP] Re: php/mysql - getting ID of query

2007-08-21 Thread M. Sokolewicz
John Pillion wrote: This is as much a mysql question as it is php. What is the most reliable way to retrieve an auto_increment key/id for a query you just inserted? In other words, I compile all my data, insert it into a new row, and now I want to retrieve the ID it created for it in

[PHP] RE: php/mysql - getting ID of query

2007-08-21 Thread John Pillion
Thanks guys, that's exactly what I was looking for J -Original Message- From: M. Sokolewicz [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 21, 2007 4:51 PM To: John Pillion Cc: php-general@lists.php.net Subject: Re: php/mysql - getting ID of query John Pillion wrote: This is as much

Re: [PHP] MySQL Connection in Session ?

2007-06-11 Thread Satyam
In most systems, database connections are pooled, meaning that when you give them up, they are not completely closed but the sql client software keeps them in a pool available for the next script asking for a similar connection, thus saving on the time to establish a connection.It is the

Re: [PHP] MySQL Connection in Session ?

2007-06-11 Thread Stut
PHP Mailing List wrote: Can I maintain just one mysql connection resource to all my pages per user session. As far as I knows create connection is more expensive than executing queries ? No, you can't store resources (of which mysql connections are one example) in sessions. Any reference

Re: [PHP] MySQL UTF-8 vs Extended ASCII

2007-06-11 Thread Larry Garfield
The underlying problem is that there is no one Extended ASCII. There's a dozen or so different schemes for the 129-255 range, all of them incompatible. That's why Unicode now exists. :-) I've been tracking this issue myself on my blog, which may be of background use for you (especially some

Re: [PHP] MySQL UTF-8 vs Extended ASCII

2007-06-11 Thread Richard Lynch
On Mon, June 11, 2007 7:34 pm, Larry Garfield wrote: You may find this useful: http://us.php.net/manual/en/function.mb-convert-encoding.php It is frequently reasonably good at guessing the incoming character set, at least the one time we used it at work. Try running all pages/strings

Re: [PHP] MySQL change-tracking

2007-05-03 Thread Chris
Richard Lynch wrote: On Wed, May 2, 2007 4:32 pm, Brad Fuller wrote: Richard Lynch wrote: I have this simple database and I'm going to have a handful of people editing it... I'd like to track each and every edit with username, and, ideally, provide myself an easy Undo if I decide [bleep] is

RE: [PHP] MySQL change-tracking

2007-05-02 Thread Brad Fuller
Richard Lynch wrote: I have this simple database and I'm going to have a handful of people editing it... I'd like to track each and every edit with username, and, ideally, provide myself an easy Undo if I decide [bleep] is an idiot and shouldn't have done that. Now, I'm not real

RE: [PHP] MySQL change-tracking

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 4:32 pm, Brad Fuller wrote: Richard Lynch wrote: I have this simple database and I'm going to have a handful of people editing it... I'd like to track each and every edit with username, and, ideally, provide myself an easy Undo if I decide [bleep] is an idiot and

Re: [PHP] mysql if empty

2007-04-11 Thread tedd
At 5:53 PM -0700 4/10/07, Jim Lucas wrote: Anyways, here is the expanded version hopefully to your liking. ?php // do that db connection thing... // select you database $sql = SELECT Client FROM booked WHERE Name = 'larry' ; if

Re: [PHP] mysql if empty

2007-04-11 Thread Jim Lucas
tedd wrote: At 5:53 PM -0700 4/10/07, Jim Lucas wrote: Anyways, here is the expanded version hopefully to your liking. ?php // do that db connection thing... // select you database $sql = SELECT Client FROM booked WHERE Name = 'larry' ; if ( ( $result =

Re: [PHP] mysql if empty

2007-04-10 Thread tedd
At 10:18 PM +0100 4/9/07, [EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return No result found always returns Found even though the recoed does not exist... $sql = SELECT Client FROM booked WHERE Name = 'larry'; $result =

Re: [PHP] mysql if empty

2007-04-10 Thread Jim Lucas
[EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return No result found always returns Found even though the recoed does not exist... $sql = SELECT Client FROM booked WHERE Name = 'larry'; $result = mysql_query($sql); if ($result ==

Re: [PHP] mysql if empty

2007-04-10 Thread Richard Lynch
$result == means: Your SQL query is so f'ed up, I couldn't even run it. It does NOT mean: Your query returned zero rows, a perfectly normal and common condition. You want http://php.net/mysql_num_rows And, actually, $result is FALSE, not really , when the query is wrong. On Mon, April 9, 2007

Re: [PHP] mysql if empty

2007-04-10 Thread Richard Lynch
I am amazed by the sheer number of just plain WRONG answers to this one... Were they all from April 1 or something?... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP

Re: [PHP] mysql if empty

2007-04-10 Thread Lori Lay
Richard Lynch wrote: I am amazed by the sheer number of just plain WRONG answers to this one... Were they all from April 1 or something?... Yes it's unfortunate. I think part of the problem was that several people, including myself, weren't entirely clear on what he was after. When I

Re: [PHP] mysql if empty

2007-04-10 Thread tg-php
Turn on MAGIC QUOTES and REGISTER GLOBALS Once you've done that, install Postgres. Run your MySQL command again, Postgres has much better error reporting and will assist in debugging the situation. You might consider replacing your javascript functions with PHP ones since JS can sometimes

Re: [PHP] mysql if empty

2007-04-10 Thread Jim Lucas
Richard Lynch wrote: I am amazed by the sheer number of just plain WRONG answers to this one... Were they all from April 1 or something?... so, are you saying that my answer was wrong, or just making a statement. If my answer was wrong, it was because it was too simple, which is what I was

Re: [PHP] mysql if empty

2007-04-10 Thread Jim Lucas
[EMAIL PROTECTED] wrote: Turn on MAGIC QUOTES and REGISTER GLOBALS Once you've done that, install Postgres. Run your MySQL command again, Postgres has much better error reporting and will assist in debugging the situation. You might consider replacing your javascript functions with PHP ones

Re: [PHP] mysql if empty

2007-04-10 Thread Richard Lynch
No. Despite the fact that I replied to your message as it was the last one, and that caused threaded mail readers to place my post directly under yours as a reply, my comment was not specifically directed at your post. I had deleted the way wrong posts by the time I realized I wanted to say

Re: [PHP] mysql if empty

2007-04-10 Thread Robert Cummings
On Tue, 2007-04-10 at 20:48 -0500, Richard Lynch wrote: No. Despite the fact that I replied to your message as it was the last one, and that caused threaded mail readers to place my post directly under yours as a reply, my comment was not specifically directed at your post. I had deleted

Re: [PHP] mysql if empty

2007-04-10 Thread tg-php
Top-posting is sublime. Embrace it. Why scroll through 10 pages of emails you've already read when you can get to the meat of it all in the first few lines of an email? :) Plus trying to quickly separate all the previous replies from the latest one when some emailers indent, indent with

Re: [PHP] mysql if empty

2007-04-09 Thread afan
If I search for something in mysql that returns an empty result I cant get it to return No result found always returns Found even though the recoed does not exist... $sql = SELECT Client FROM booked WHERE Name = 'larry'; $result = mysql_query($sql); if ($result == ) { echo No result

Re: [PHP] mysql if empty

2007-04-09 Thread Lori Lay
[EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return No result found always returns Found even though the recoed does not exist... $sql = SELECT Client FROM booked WHERE Name = 'larry'; $result = mysql_query($sql); if ($result ==

Re: [PHP] mysql if empty

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 18:27, Lori Lay escreveu: [EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return No result found always returns Found even though the recoed does not exist... $sql = SELECT Client FROM booked WHERE

Re: [PHP] mysql if empty

2007-04-09 Thread Paul Novitski
At 4/9/2007 02:18 PM, [EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return No result found always returns Found even though the recoed does not exist... $sql = SELECT Client FROM booked WHERE Name = 'larry'; $result =

Re: [PHP] mysql if empty

2007-04-09 Thread Satyam
An empty result is still a valid result. As long as the SQL statement is valid, you will get a result set. This doesn't meant that the variable holding the reference to the result set is itself empty, but that you will fail to fetch any results from it. Satyam - Original Message -

Re: [PHP] MySQL exceptions

2007-04-09 Thread Jochem Maas
Davi wrote: Hi all! I'm developing an OOP app using PHP 5. I want to use try-catch with mysql functions. So, the question is: what are the exceptions classes of MySQL? Where can I found it? IIRC mysqli (certainly not mysql) extension does not throw exceptions, so write code that checks

[PHP] Re: php-mysql problem

2007-04-03 Thread itoctopus
$sql = SELECT count(Email) as numEmails, Email FROM mena_guests WHERE Voted='yes' GROUP BY Email ORDER BY numEmails DESC LIMIT $startingID, $items_numbers_list; -- itoctopus - http://www.itoctopus.com Me2resh Lists [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi i need help

[PHP] Re: php-mysql problem

2007-04-03 Thread itoctopus
$sql = SELECT count(Email) as numEmails, Email FROM mena_guests WHERE Voted='yes' GROUP BY Email ORDER BY numEmails DESC LIMIT $startingID, $items_numbers_list; I answered this morning, I don't know why it got deleted -- itoctopus - http://www.itoctopus.com Me2resh Lists [EMAIL PROTECTED] wrote

[PHP] Re: PHP+MySQL website cache ? Yes/No

2007-02-25 Thread Colin Guthrie
Martin Zvarík wrote: I did a benchmark with and without caching to HTML file and it's like: 0.0031 sec (with) and 0.0160 sec (with database) I know these miliseconds don't matter, but it will have significant contribution in high-traffic website, won't it? I would say yes. A good caching

Re: [PHP] Mysql strategy

2006-11-22 Thread Dotan Cohen
On 21/11/06, Richard Lynch [EMAIL PROTECTED] wrote: On Sun, November 12, 2006 6:02 pm, Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword 2) To select the varchar field

Re: [PHP] Mysql strategy

2006-11-22 Thread tedd
At 1:50 PM +0200 11/22/06, Dotan Cohen wrote: Thanks, Richard. I'm looking into the full text index again. Dotan Cohen Dotan: The following is a great reference -- the code works and it gave me the basics to do full-text searches. http://www.phpfreaks.com/tutorials/129/0.php Go though

Re: [PHP] Mysql strategy

2006-11-22 Thread Dotan Cohen
On 22/11/06, tedd [EMAIL PROTECTED] wrote: At 1:50 PM +0200 11/22/06, Dotan Cohen wrote: Thanks, Richard. I'm looking into the full text index again. Dotan Cohen Dotan: The following is a great reference -- the code works and it gave me the basics to do full-text searches.

Re: [PHP] Mysql strategy

2006-11-15 Thread David Tulloh
Chris wrote: David Tulloh wrote: Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword 2) To select the varchar field from all the rows, and search through them with php's

Re: [PHP] Mysql strategy

2006-11-14 Thread Raphael Martins
Larry Garfield escreveu: On Monday 13 November 2006 17:51, Chris wrote: It's not going to make a great deal of difference if you do the processing in the MySQL or the PHP, in this case it's basically the same operation in each. I suspect that efficiently recreating the LIKE functionality

Re: [PHP] Mysql strategy

2006-11-14 Thread Dotan Cohen
On 14/11/06, Larry Garfield [EMAIL PROTECTED] wrote: As a general rule, I try to push as much logic into the query as I can for the simple reason that MySQL is optimized C and my PHP code gets interpreted. The odds of me writing something in PHP that's faster than MySQL AB's C code are slim. :-)

Re: [PHP] Mysql strategy

2006-11-13 Thread Dotan Cohen
On 13/11/06, Chris [EMAIL PROTECTED] wrote: Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword No. Horribly inefficient. 2) To select the varchar field from all the

Re: [PHP] Mysql strategy

2006-11-13 Thread Dotan Cohen
On 13/11/06, David Tulloh [EMAIL PROTECTED] wrote: Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword 2) To select the varchar field from all the rows, and search

Re: [PHP] Mysql strategy

2006-11-13 Thread David Tulloh
Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword 2) To select the varchar field from all the rows, and search through them with php's array functions? It's not going to

Re: [PHP] Mysql strategy

2006-11-13 Thread Robert Cummings
On Tue, 2006-11-14 at 00:51 +1100, David Tulloh wrote: Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword 2) To select the varchar field from all the rows, and search

Re: [PHP] Mysql strategy

2006-11-13 Thread Chris
David Tulloh wrote: Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword 2) To select the varchar field from all the rows, and search through them with php's array functions?

Re: [PHP] Mysql strategy

2006-11-13 Thread Larry Garfield
On Monday 13 November 2006 17:51, Chris wrote: It's not going to make a great deal of difference if you do the processing in the MySQL or the PHP, in this case it's basically the same operation in each. I suspect that efficiently recreating the LIKE functionality in PHP wouldn't be

Re: [PHP] Mysql strategy

2006-11-12 Thread Chris
Dotan Cohen wrote: If I have to perform 30 LIKE searches for different keywords in a varchar field, which strategy would be recommended: 1) 30 searches, one for each keyword No. Horribly inefficient. 2) To select the varchar field from all the rows, and search through them with php's array

Re: [PHP] mysql-* versus db_* statements

2006-06-26 Thread David Tulloh
It's currently a little bit late in the US and you only waited 2 hours since your last post. While this is an international list the majority of the posters are US based. Not getting a response within two hours at this time is not unusual and you should probably be more patient. As for your

Re: [PHP] mysql-* versus db-* statements

2006-06-26 Thread Jochem Maas
[EMAIL PROTECTED] wrote: ... $link = mysql_connect(localhost, root, 040573); what was your IP address again? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql ORDER BY problem

2006-06-18 Thread Rob W.
Yeah, I got this problem fixed. The datbase was listed under [chr] instead of [integer]. Thanks for the help though. - Original Message - From: Xavier Casto To: Rob W. Cc: php-general@lists.php.net Sent: Sunday, June 18, 2006 7:30 PM Subject: Re: [PHP] mysql ORDER

Re: [PHP] mysql + PHP

2006-06-15 Thread Satyam
perhaps this will work: Select country , name from tbl_chassis order by ifnull(country,'') didn't try it. - Original Message - From: weetat [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, June 15, 2006 8:14 AM Subject: [PHP] mysql + PHP Hi all, I have SQL

Re: [PHP] mysql + PHP

2006-06-15 Thread weetat
hi , not working . The empty value still sorted first. Thanks. Satyam wrote: perhaps this will work: Select country , name from tbl_chassis order by ifnull(country,'') didn't try it. - Original Message - From: weetat [EMAIL PROTECTED] To: php-general@lists.php.net Sent:

Re: [PHP] mysql + PHP

2006-06-15 Thread Satyam
-general@lists.php.net; Satyam [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Thursday, June 15, 2006 8:51 AM Subject: Re: [PHP] mysql + PHP hi , not working . The empty value still sorted first. Thanks. Satyam wrote: perhaps this will work: Select country , name from tbl_chassis order

Re: [PHP] mysql + PHP

2006-06-15 Thread Martin Alterisio
2006/6/15, weetat [EMAIL PROTECTED]: Hi all, I have SQL query , for example , Select country , name from tbl_chassis order by country. The problem of the sql statement is that , if there are empty value in country field , it be sorted first . How to do sorting the empty value last ? I

Re: [PHP] mysql + PHP

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 1:14 am, weetat wrote: I have SQL query , for example , Select country , name from tbl_chassis order by country. The problem of the sql statement is that , if there are empty value in country field , it be sorted first . How to do sorting the empty value last ?

Re: [PHP] mysql + PHP

2006-06-15 Thread weetat
Thank all for your inputs. Yes . the data should be null , really bad data , will try to change database structure. Richard Lynch wrote: On Thu, June 15, 2006 1:14 am, weetat wrote: I have SQL query , for example , Select country , name from tbl_chassis order by country. The problem

Re: [PHP] mysql + PHP

2006-06-15 Thread tedd
At 2:14 PM +0800 6/15/06, weetat wrote: Hi all, I have SQL query , for example , Select country , name from tbl_chassis order by country. The problem of the sql statement is that , if there are empty value in country field , it be sorted first . How to do sorting the empty value last ? I

Re: [PHP] MySQL - HEAP table type

2006-05-13 Thread chris smith
On 5/14/06, Martin Zvarík [EMAIL PROTECTED] wrote: Hi, I am sorry for this not being really a PHP question, anyway I use MySQL database, I have a table, which is HEAP (memory) type and I found out I can store only about 22000 entries in it, then when I want to insert new entry it gives me an

Re: [PHP] MySQL - HEAP table type

2006-05-13 Thread John Nichel
Martin Zvarík wrote: Hi, I am sorry for this not being really a PHP question So you know it's off topic, yet you're going to ask anyway. MySQL database, I have a table, which is HEAP (memory) type and I found out I can store only about 22000 entries in it, then when I want to insert new

Re: [PHP] Re: php mysql problem

2006-05-03 Thread Richard Lynch
On Tue, May 2, 2006 7:05 am, Ross wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. Change item_id 3 to 1. ... select id

Re: [PHP] Re: php mysql problem

2006-05-03 Thread Richard Lynch
On Tue, May 2, 2006 7:22 am, chris smith wrote: On 5/2/06, Ross [EMAIL PROTECTED] wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are

Re: [PHP] Re: php mysql problem

2006-05-03 Thread chris smith
On 5/3/06, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, May 2, 2006 7:22 am, chris smith wrote: On 5/2/06, Ross [EMAIL PROTECTED] wrote: This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down

[PHP] Re: php mysql problem

2006-05-02 Thread Barry
Ross schrieb: Just say I have a db CREATE TABLE `mytable` ( `id` int(4) NOT NULL auto_increment, `fileName` varchar(50) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; when I add items they go id 1,2,3 etc. Whn I delete them gaps appear.

[PHP] Re: php mysql problem

2006-05-02 Thread Ross
This is my database now...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. CREATE TABLE `board_papers` ( `id` int(4) NOT NULL auto_increment, `doc_date`

<    1   2   3   4   5   6   7   8   9   10   >