Re: [PHP] mysql question

2008-12-29 Thread Phpster
The mysql forum is the best place. Note that their holiday schedule may mean some lag in getting answers. Bastien Sent from my iPod On Dec 29, 2008, at 7:51 AM, ann kok oiyan...@yahoo.ca wrote: Hi all Do you know any websites for mysql question? I do submit the mysql forum but I would

[PHP] Re: PHP/mySQL question using ORDER BY with logic

2008-10-26 Thread Carlos Medina
Rob Gould schrieb: Question about mySQL and PHP, when using the mySQL ORDER BY method... Basically I've got data coming from the database where a wine producer-name is a word like: Château Bahans Haut-Brion or La Chapelle de La Mission Haut-Brion or Le Clarence

[PHP] Re: PHP/mySQL question using ORDER BY with logic

2008-10-24 Thread Colin Guthrie
Robert Cummings wrote: On Fri, 2008-10-24 at 00:18 -0400, Rob Gould wrote: Question about mySQL and PHP, when using the mySQL ORDER BY method... Basically I've got data coming from the database where a wine producer-name is a word like: Château Bahans Haut-Brion or

Re: [PHP] mysql question

2008-02-14 Thread Richard Lynch
On Sun, February 10, 2008 11:52 am, Per Jessen wrote: nihilism machine wrote: $ret = mysql_result($r, 0); mysql_free_result($r); if ($this-auto_slashes) return stripslashes($ret); else return $ret; } what is $ret, an array? No, it's a mysql result object. No, it's a single field

Re: [PHP] mysql question #2

2008-02-14 Thread Richard Heyes
At any rate, just seeing this tells me that you've got a real mess on your hands... Or you could say, You're going to have some fun cleaning that. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new

Re: [PHP] mysql question #2

2008-02-14 Thread Richard Lynch
On Sun, February 10, 2008 12:12 pm, nihilism machine wrote: public function select_one($sql) { if ($this-auto_slashes) { return stripslashes($ret); If you have to call stripslashes() on data coming FROM MySQL, then you have really messed up... You've

Re: [PHP] mysql question

2008-02-11 Thread Daniel Brown
On Feb 10, 2008 1:03 PM, Per Jessen [EMAIL PROTECTED] wrote: Yep, you're right - I read mysql_query where the OP said mysql_result. Don't feel bad. I did the exact same thing when I was reading over the post just now. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--;

Re: [PHP] mysql question

2008-02-10 Thread Nathan Nobbe
On Feb 10, 2008 12:52 PM, Per Jessen [EMAIL PROTECTED] wrote: nihilism machine wrote: $ret = mysql_result($r, 0); mysql_free_result($r); if ($this-auto_slashes) return stripslashes($ret); else return $ret; } what is $ret, an array? No, it's a mysql result object. no, its the

Re: [PHP] mysql question

2008-02-10 Thread Per Jessen
nihilism machine wrote: $ret = mysql_result($r, 0); mysql_free_result($r); if ($this-auto_slashes) return stripslashes($ret); else return $ret; } what is $ret, an array? No, it's a mysql result object. if so how can i access the individual rows in it? Look up mysql_fetch_assoc().

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) {

[PHP] Re: php mySql question

2005-07-27 Thread axel
Sure that your php.ini is located correctly? I have installed php 5.0.4 on my windows 2000, IIS 6.0 server. PHP works but when I try to connect to MySQL I get the Fatal error: Call to undefined function mysql_connect(). I have uncommented the line in the php.ini file that says

Re: [PHP] mysql question

2004-01-16 Thread Christian Calloway
Well let me try and describe a simplified version of what I am doing. I work for a group of analysts, and they analyse technical products. Each products has about 300+ fields associated with it, and each product is vastly different from the other. Let's say the product foo has a table fields

Re: [PHP] mysql question

2004-01-16 Thread Miles Thompson
Christian, I did a bit of digging in the MySQL docs to try and find the limits on number of fields in a table, etc. Didn't have much luck. I would not worry about thousands, or even hundreds of thousands of rows in a table for two reasons. First MySQL is becoming a heavier-duty database, and

Re: [PHP] mysql question

2004-01-16 Thread Christian Calloway
Hey Mike, That is almost exactly what I am doing. I have a table, lets say product_fields which describes each characteristic/field of a product (with N possible fields). A definition of a field includes, its name (as the customer see's it), its type, a named-reference to the field in the data

Re: [PHP] MySQL Question

2004-01-15 Thread CPT John W. Holmes
From: John Taylor-Johnston [EMAIL PROTECTED] Sorry, don't want to be off-topic, but have found something curious about MySQL 4.0.16-standard. It does not seem to prioritise properly. Searching for 'English Canada' (as opposed to +English +Canada) gives me all instances of both words but does

Re: [PHP] mysql question

2004-01-15 Thread Miles Thompson
Christian, A red flag is flying. Usually, when people start talking about how the number of tables will multiply in an application, there is a problem with the design of data structures. If that's the case, now is the time to fix it. Miles At 05:35 PM 1/15/2004 +, Christian Calloway

Re: [PHP] Mysql question

2003-11-18 Thread Raditha Dissanayake
Creating new databases is usually done with the mysql root account. Bad idea to use this account in a php script. Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table, but I can not

Re: [PHP] Mysql question

2003-11-18 Thread Lists
This is for an intranet application, I trust my users. Michael On Wed, 19 Nov 2003, Raditha Dissanayake wrote: Creating new databases is usually done with the mysql root account. Bad idea to use this account in a php script. Lists wrote: I have a db in sql, and I need a php/mysql

RE: [PHP] Mysql question

2003-11-18 Thread Vail, Warren
I don't believe there is one command that does all this, so you've already ruled out one good option, but you can use PHPMyAdmin. Do you have PHPMyAdmin installed on either or both sites? Warren -Original Message- From: Lists [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003

Re: [PHP] Mysql question

2003-11-18 Thread John Nichel
Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table, but I can not figure out how to do this with a whole db. I also know that I could do it using mysql dump, but I don't want to have to

Re: [PHP] Mysql question

2003-11-18 Thread Raditha Dissanayake
Hi John, ASAIK you are right. Michael, if you use the root account in php you will be able to do what John says. John Nichel wrote: Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table,

Re: [PHP] Mysql question

2003-11-18 Thread John W. Holmes
Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table, but I can not figure out how to do this with a whole db. I also know that I could do it using mysql dump, but I don't want to have to

Re: [PHP] Mysql question

2003-11-18 Thread Greg Donald
On Tue, 18 Nov 2003, Lists wrote: I have a db in sql, and I need a php/mysql query/command to copy the entire db (schema and data) to a new db. I know how to do this with a table, but I can not figure out how to do this with a whole db. I also know that I could do it using mysql dump, but I

Re: [PHP] mysql question

2002-10-30 Thread 1LT John W. Holmes
Yes...off topic... Join the table with itself. untested... SELECT t1.shopnumber, t1.item from table t1, table t2 where t1.shopnumber = 1 and t1.shopnumber = t2.shopnumber and t1.item != t2.item Something like that?? Play around with it... ---John Holmes... - Original Message - From:

Re: [PHP] mysql question

2002-07-26 Thread Lowell Allen
From: Christian Calloway [EMAIL PROTECTED] Sorry this may be a little offtopic, but I am currently moving a site I was developing from coldfusion+MSAccess to PHP+MySQL. I remembered reading somewhere that there is a utility that will convert/transfer (data and structure) a MSAcess database

Re: [PHP] mysql question

2002-07-26 Thread Tech Support
Congrats! Good choice! Take a look here: http://www.convert-in.com/acc2sql.htm or here: http://www.google.com/search?hl=enlr=ie=ISO-8859-1q=convert+access+databa se+to+mysql Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: Christian Calloway [EMAIL

Re: [PHP] mysql question

2002-07-12 Thread Alberto Serra
ðÒÉ×ÅÔ! John Holmes wrote: Gesundheit *if* that was on Oracle *and* the table was big you'd notice that your performance goes down. Don't ask me why. And I never checked it on MySql. But watch out for betweens. Check them. Yes, good point. I don't know if it matters in MySQL either, but

Re: [PHP] mysql question

2002-07-11 Thread Miles Thompson
Yes, though I'd probably add parentheses to make it clearer. select * from table where ((start_shot = $current_shot) and (end_shot = $current_shot)) Though that's probably not necessary. Make certain you have your less than's and greater thans set the right way, I've often sat slack-mouthed

Re: [PHP] mysql question

2002-07-11 Thread 1LT John W. Holmes
... - Original Message - From: Miles Thompson [EMAIL PROTECTED] To: Alexander Ross [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, July 11, 2002 12:24 PM Subject: Re: [PHP] mysql question Yes, though I'd probably add parentheses to make it clearer. select * from table where

Re: [PHP] mysql question

2002-07-11 Thread Alberto Serra
ðÒÉ×ÅÔ! 1LT John W. Holmes wrote: How about SELECT * FROM table WHERE $current_shot BETWEEN start_shot AND end_shot *if* that was on Oracle *and* the table was big you'd notice that your performance goes down. Don't ask me why. And I never checked it on MySql. But watch out for betweens.

Re: [PHP] mysql question

2002-07-11 Thread Alberto Serra
ðÒÉ×ÅÔ! Alexander Ross wrote: I realize this isn't a php question, but I figured that someone here knows of a good mysql newsgroup and in the mean time someone here probaby knows the answer to my question. Can I set up a query like this: select * from table where start_shot =

RE: [PHP] mysql question

2002-07-11 Thread John Holmes
ðÒÉ×ÅÔ! Gesundheit 1LT John W. Holmes wrote: How about SELECT * FROM table WHERE $current_shot BETWEEN start_shot AND end_shot *if* that was on Oracle *and* the table was big you'd notice that your performance goes down. Don't ask me why. And I never checked it on MySql. But watch

RE: [PHP] MySQL question

2002-04-21 Thread .ben
In brief, and in no way finished (no error trapping, commenting, etc)... ? $db = mysql_connect(localhost, root); mysql_select_db(test,$db); $result = mysql_query(SELECT CountryID, CountryName FROM tblcountries,$db); echo table border=1\n; echo tr\n;

RE: [PHP] mysql question

2002-04-08 Thread Rick Emery
mysql is a relational database. therefore, the concept of a row number is irrelevant. that said, what do you REALLY want to do -Original Message- From: Julian [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 2:59 PM To: [EMAIL PROTECTED] Subject: [PHP] mysql question Hi!!! I

Re: [PHP] mysql question

2002-04-08 Thread Miguel Cruz
On Mon, 8 Apr 2002, Julian wrote: I want to know if there is a function to know which is the number of the row that I selected. Not in MySQL. You should add an auto_increment index field to your table, and then you can always use that to see where you are. miguel -- PHP General Mailing

RE: [PHP] mysql question

2002-04-08 Thread James E. Hicks III
Why don't you just increment a counter as you are retrieving them. mysql_select_db(some_DB) or die(DB not available); $query = select some_data from some_table; $result = mysql_query($query); $rowcounter=0; while ($row=mysql_fetch_array($result)){ extract($row); $rowcounter++; echo(You

[PHP] RE:[PHP] mysql question

2002-04-08 Thread Julian
Thanks James! It is the perfect answer for my cuestion!!! Regards! Julian - Original Message - From: James E. Hicks III To: Julian ; [EMAIL PROTECTED] Sent: Monday, April 08, 2002 5:12 PM Subject: RE: [PHP] mysql question Why don't you just increment a counter as you

Re: [PHP] mysql question

2002-03-19 Thread Hiroshi Ayukawa
Hello, The length of VARCHAR must be specified like; CREATE TABLE sailordata ( sailorid INT(8) NOT NULL DEFAULT 0, lastname VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, middlenames VARCHAR(255) NOT NULL, dob VARCHAR(255) NOT NULL, telephone VARCHAR(255) NOT NULL,

Re: [PHP] MySQL question...not sure if this is the correct forum to ask.

2002-02-14 Thread DL Neil
Peter, I have a quick MySQL question...if this is not the correct forum for it, then someone please point me to the right one. Can the UPDATE statement have conditional check embedded in it? I have a page that displays a record (in a FORM format) that the user can change the

Re: [PHP] Mysql question

2002-02-06 Thread Emiliano Marmonti
PROTECTED] To: Emiliano Marmonti [EMAIL PROTECTED] Date: Wednesday, February 06, 2002 12:45 PM Subject: Re: [PHP] Mysql question This is really a question for a MySQL mailing list, not a PHP list since this question has nothing to do with PHP. You can email the MySQL mailing list at [EMAIL

Re: [PHP] mySQL Question....

2001-04-18 Thread Toby Miller
How about actually using distinct? SELECT DISTINCT(email_addr) FROM myTable WHERE x = 1 --Toby - Original Message - From: "Jason Caldwell" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 1:47 AM Subject: [PHP] mySQL Question if i perform a SELECT query

RE: [PHP] mySQL Question....

2001-04-17 Thread Opec Kemp \( Ozemail \)
if i perform a SELECT query (say) like the following: SELECT email_addr FROM myTable WHERE x = 1 in this query i want to pull-out (or list) all email addresses where x equals 1, however, suppose i don't want any duplicate email addresses... would i use ORDER BY and COUNT(*) to get listing

Re: [PHP] mySQL Question....

2001-04-17 Thread Jason Caldwell
Opps. I meant GROUP BY... and it looks like I don't need to include the COUNT(). SELECT email_addr, x GROUP BY email_addr HAVING x = 1; Is this the only way to display a listing without duplicates, or is there a more efficient (faster) way? I don't want to DELETE the duplicates, just don't

Re: [PHP] mySQL Question....

2001-04-17 Thread Don Read
On 18-Apr-01 Jason Caldwell wrote: Opps. I meant GROUP BY... and it looks like I don't need to include the COUNT(). SELECT email_addr, x GROUP BY email_addr HAVING x = 1; Is this the only way to display a listing without duplicates, or is there a more efficient (faster) way? I don't

Re: [PHP] Mysql Question

2001-02-03 Thread Richard Lynch
Can i know the date of the last table update in a Mysql database? You can add a field named 'modified' that is of type 'timestamp' and use: select max(modified) from blah; I don't know of any documented way to check the last modified time for a whole table. -- Visit the Zend Store at