[php-list] MySQL finding same words

2008-11-22 Thread pirate_lenny
I'm trying to find similar rows by keyword. I've got a keyword column and am having problems finding all rows that have a single keyword. So, if a keywords are: php mysql perplexed newbie And I'm trying to find all rows with "newbie" in the keyword column, how do I write a WHERE statement to do

Re: [php-list] MySQL field type information

2008-11-20 Thread Pete
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes >Hello HELLBOY, > >Thank you, absolutely perfect! > >Just one other thing would be helpful. > >Can anyone give me a link to information that describes the information >returned >in the fields 'KEY' >and 'EXTRA'? > >Thanks all, Robert. In

Re: [php-list] MySQL field type information

2008-11-20 Thread HELLBOY
On Thu, Nov 20, 2008 at 4:10 PM, listgroups08 wrote: >- Original Message - > From: "HELLBOY" > > > Hello all, > > I want to know how to get information about field types. I am using > MyISAM. > > > > I can see some MySQL instructions that can do this for one field at a > time > > but I

Re: [php-list] MySQL field type information

2008-11-20 Thread listgroups08
- Original Message - From: "HELLBOY" > Hello all, > I want to know how to get information about field types. I am using MyISAM. > > I can see some MySQL instructions that can do this for one field at a time > but I want to get the > stats for a whole table at once. > > For example - > >

Re: [php-list] MySQL field type information

2008-11-20 Thread HELLBOY
On Thu, Nov 20, 2008 at 3:00 PM, listgroups08 wrote: > Hello all, > I want to know how to get information about field types. I am using MyISAM. > > I can see some MySQL instructions that can do this for one field at a time > but I want to get the > stats for a whole table at once. > > For exampl

[php-list] MySQL field type information

2008-11-20 Thread listgroups08
Hello all, I want to know how to get information about field types. I am using MyISAM. I can see some MySQL instructions that can do this for one field at a time but I want to get the stats for a whole table at once. For example - How do I get information on each field of a table

Re: [php-list] MySQL and browser close

2008-11-06 Thread James Keeline
--- On Thu, 11/6/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a simple question about what may happen > when a web page that is accessing MySQL > is closed by the browser. > > I have to script a database in simple MySQL and I need to > be able to detect when a roll back > condit

[php-list] MySQL and browser close

2008-11-06 Thread listgroups08
Hello all, I have a simple question about what may happen when a web page that is accessing MySQL is closed by the browser. I have to script a database in simple MySQL and I need to be able to detect when a roll back condition may exist. If a web page has a MySQL transaction such

Re: [php-list] mysql LIMIT/COUNT again

2008-10-13 Thread listgroups08
- Original Message - From: "Daniel Israel" On Oct 12, 2008, at 6:31 PM, wrote: Try: SELECT COUNT(*) FROM Assignments, Classes, Instructors, Departments WHERE Assignments.ClassID = Classes.ClassID AND Classes.DepartmentID =

Re: [php-list] mysql LIMIT/COUNT again

2008-10-12 Thread Daniel Israel
On Oct 12, 2008, at 6:31 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED] > wrote: > Hi, >I am using the following query to get results from a mysql > database. > > $query = 'SELECT * FROM Assignments, Classes, Instructors, > Departments'; > $query .= ' WHERE Assignments.ClassID = Classes.Cla

[php-list] mysql LIMIT/COUNT again

2008-10-12 Thread listgroups08
Hi, I am using the following query to get results from a mysql database. $query = 'SELECT * FROM Assignments, Classes, Instructors, Departments'; $query .= ' WHERE Assignments.ClassID = Classes.ClassID'; $query .= ' AND Classes.DepartmentID = Departments.DepartmentID'; $query .= ' AND Classes.

Re: [php-list] MySql problems

2008-10-12 Thread Daniel Israel
On Oct 11, 2008, at 1:08 PM, chellieclk wrote: > Hi Everyone. I am having a bit of a mysterious error that I cannot > find a solution to. > I can manually assign a value to $uid and everything works. With a > var though, I keep > getting an error about mysql _query not having a valid resource

Re: [php-list] MySql problems

2008-10-11 Thread Patrick Bierans
> $sql = "SELECT u_name FROM members WHERE u_name = {$uid}"; in general this should be the correct way: $sql = "SELECT u_name FROM members WHERE u_name = ".$uid; if you are paranoid you should go for typecasting: $sql = "SELECT u_name FROM members WHERE u_name = ".(int)$uid; if you are paranoid

[php-list] MySql problems

2008-10-11 Thread chellieclk
Hi Everyone. I am having a bit of a mysterious error that I cannot find a solution to. I can manually assign a value to $uid and everything works. With a var though, I keep getting an error about mysql _query not having a valid resource. I cannot get variables to work in my sql statements; I ha

Re: [php-list] mysql LIMIT / COUNT

2008-10-11 Thread Patrick Bierans
[EMAIL PROTECTED] schrieb: > > Hi all, > > I have a quick question. > > If I am getting a small range of results using the mysql LIMIT > function then how can I tell how many results there would have been > if I didn't use LIMIT with the same query? > > Thanks. > use a "select count(*)" without th

[php-list] mysql LIMIT / COUNT

2008-10-10 Thread listgroups08
Hi all, I have a quick question. If I am getting a small range of results using the mysql LIMIT function then how can I tell how many results there would have been if I didn't use LIMIT with the same query? Thanks.

Re: [php-list] MYSQL - Left join query

2008-09-22 Thread Gordon Stewart
On 9/20/08, Daniel Israel <[EMAIL PROTECTED]> wrote: > Probably easier to do something like this: > > SELECT question_id, question_text, is_approved, language > FROM questions WHERE question_id NOT IN (SELECT question_id FROM > questions_categories) Thanks - Works perfectly :) -- G

Re: [php-list] MYSQL - Left join query

2008-09-19 Thread Daniel Israel
On Sep 19, 2008, at 10:49 AM, Gordon Stewart wrote: > Hi, > > I'm following the example here :- > > http://forums.mysql.com/read.php?52,138724,138727#msg-138727 > > > I've been designing a SELECT query on two tables.. -It seems to be > working... But i want to confirm its correct before I do any

[php-list] MYSQL - Left join query

2008-09-19 Thread Gordon Stewart
Hi, I'm following the example here :- http://forums.mysql.com/read.php?52,138724,138727#msg-138727 I've been designing a SELECT query on two tables.. -It seems to be working... But i want to confirm its correct before I do any UPDATE commands $query = " SELECT q.question_id, q.question_te

Re: [php-list] MySQL 5 to MySQL 4

2008-05-01 Thread Phill Sparks
On Thu, May 1, 2008 at 10:49 PM, James Keeline <[EMAIL PROTECTED]> wrote: > --- Phill Sparks <[EMAIL PROTECTED]> wrote: > >> An example of the full query is... >> >> SELECT SQL_CALC_FOUND_ROWS uri, COUNT(tag) AS related_tag_count >> FROM ( >> SELECT subject AS uri, object AS tag >> FROM milk_proper

Re: [php-list] MySQL 5 to MySQL 4

2008-05-01 Thread James Keeline
--- Phill Sparks <[EMAIL PROTECTED]> wrote: > An example of the full query is... > > SELECT SQL_CALC_FOUND_ROWS uri, COUNT(tag) AS related_tag_count > FROM ( > SELECT subject AS uri, object AS tag > FROM milk_properties prop > INNER JOIN milk_posts model > ON model.uri = prop.subject > AND model.

Re: [php-list] MySQL 5 to MySQL 4

2008-05-01 Thread Phill Sparks
On Thu, May 1, 2008 at 8:53 PM, James Keeline <[EMAIL PROTECTED]> wrote: > --- Phill Sparks <[EMAIL PROTECTED]> wrote: > >> Hi Group, >> >> I've just moved hosts and sadly they're running MySQL 4.1.22 and a >> query running on my previous host (MySQL 5.0.45) has stopped >> working... >> >> I've got

Re: [php-list] MySQL 5 to MySQL 4

2008-05-01 Thread James Keeline
--- Phill Sparks <[EMAIL PROTECTED]> wrote: > Hi Group, > > I've just moved hosts and sadly they're running MySQL 4.1.22 and a > query running on my previous host (MySQL 5.0.45) has stopped > working... > > I've got a nice nested query (see http://www.milk-hub.net/pb/08 ) that > gets related con

[php-list] MySQL 5 to MySQL 4

2008-05-01 Thread Phill Sparks
Hi Group, I've just moved hosts and sadly they're running MySQL 4.1.22 and a query running on my previous host (MySQL 5.0.45) has stopped working... I've got a nice nested query (see http://www.milk-hub.net/pb/08 ) that gets related content based on tags; the outer query collates the uri (like an

Re: [php-list] MYSQL errors

2008-04-26 Thread William Piper
Gordon Stewart wrote" "On 4/26/2008 4:09 AM":" > > > CODE :- > > $query = "UPDATE `KloginUser` SET `Lastlog` = '$tr' WHERE > CONVERT(`Username` USING utf8) = '$ID' LIMIT 1;"; > $num=0; > $result=mysql_query($query) or die( "Unable to view data\n" . > mysql_error()); > $num=mysql_numrows($resul

[php-list] MYSQL errors

2008-04-26 Thread Gordon Stewart
CODE :- $query = "UPDATE `KloginUser` SET `Lastlog` = '$tr' WHERE CONVERT(`Username` USING utf8) = '$ID' LIMIT 1;"; $num=0; $result=mysql_query($query) or die( "Unable to view data\n" . mysql_error()); $num=mysql_numrows($result); Hi, This is part of my login script When I log in I'

Re: [php-list] mysql table storage efficiency

2008-04-23 Thread James Keeline
--- Tedit kap <[EMAIL PROTECTED]> wrote: > As far as table size considerations and storage efficiency I have the > following question: > > I would like to store articles in mysql table. > > I will display only the title on one page. > only title and first two sentences in two more pages. >

[php-list] mysql table storage efficiency

2008-04-23 Thread Tedit kap
Hi, As far as table size considerations and storage efficiency I have the following question: I would like to store articles in mysql table. I will display only the title on one page. only title and first two sentences in two more pages. the whole article i will display in one page only if

Re: [php-list] mysql error 1064

2008-04-03 Thread Angga Sanjaya Lingga
Now I will give you the solution. Please change your SQL Command like this: --- CREATE TABLE Member ( loginName VARCHAR(20) NOT NULL, createDate DATE NOT NULL, PRIMARY KEY(loginName)) --- Regards, --- Angga Sanjaya Lingga

Re: [php-list] mysql error 1064

2008-04-02 Thread Tedit kap
- Original Message From: Angga Sanjaya Lingga <[EMAIL PROTECTED]> To: php-list@yahoogroups.com Sent: Wednesday, April 2, 2008 1:34:03 AM Subject: Re: [php-list] mysql error 1064 Please remember to write your response BELOW the previous text. - Original Message - From:

Re: [php-list] mysql error 1064

2008-04-02 Thread Angga Sanjaya Lingga
Please remember to write your response BELOW the previous text. - Original Message - From: Tedit kap Hi, I was trying to create a table (I already created the database) using mysql query and as this was my first time ever, I just pasted the code below from a tutorial just to see what

[php-list] mysql error 1064

2008-04-01 Thread Tedit kap
Hi, I was trying to create a table (I already created the database) using mysql query and as this was my first time ever, I just pasted the code below from a tutorial just to see what is going to happen: CREATE TABLE Member ( loginName VARCHAR(20) NOT NULL, createDate DATE NOT NULL), PRIMARY KE

[php-list] MySQL Table Types & Add/Strip Slashes

2007-11-25 Thread j0hncage
I'm using a newer version of MySQL at home on a test bed system than the IT guys fixed me up with at work and one subject recently came to my attention that I guess I'd taken for granted. >From what I can tell, when attempting to ensure referential integrity between DB tables, InnoDB is the way to

Re: [php-list] MySQL date formatting vs PHP date formatting

2007-10-07 Thread James Keeline
--- Pandora <[EMAIL PROTECTED]> wrote: > On a large database where speed is very important is it better to format the > date using the MySQL DATE_FORMAT function in a query or to retrieve the date > and then use PHP to format the date? > > Currently the site is using the MySQL DATE_FORMAT functi

[php-list] MySQL date formatting vs PHP date formatting

2007-10-07 Thread Pandora
Hi, On a large database where speed is very important is it better to format the date using the MySQL DATE_FORMAT function in a query or to retrieve the date and then use PHP to format the date? Currently the site is using the MySQL DATE_FORMAT function but I've been told it is better to use PHP

Re: [php-list] MYSQL - limit....

2007-07-01 Thread Ski Dawg
On Sun, 2007-07-01 at 22:45 +1200, Gordon Stewart wrote: > ORDER BY `montha` DESC, > > Hi, my month column/field is MM format... > > The above is part of a MYSQL query...I know I can use limit 5 - > however that will get me 5 rows of datais there a way to limit by > 5 months of data ?? >

[php-list] MYSQL - limit....

2007-07-01 Thread Gordon Stewart
ORDER BY `montha` DESC, Hi, my month column/field is MM format... The above is part of a MYSQL query... I know I can use limit 5 - however that will get me 5 rows of data is there a way to limit by 5 months of data ?? EG :- (UNIQUE (ORDER BY `montha` DESC) Limit 5) - Tried that - gave

[php-list] mysql foreign key

2007-02-27 Thread Arun karthikeyan
Hi , am using phpmyadmin for database creation. i want to create a foreign key reference.. how can i create ? -With love SM.ARUNKARTIKAYAN - Get your own web address. Have a HUGE year through Yahoo! Small Business.

Re: [php-list] Mysql problem

2007-02-20 Thread Rajesh Kumar
You could try: SELECT link, COUNT(link) AS count FROM table_name GROUP BY link -- Rajesh Arun karthikeyan wrote: > Hi there, >In my table having 4 fields.That is > _id__|Link_ datano___name| > 1 | jsg/jm/c=us&js |Mar 24|__Katik > 2

[php-list] Mysql problem

2007-02-20 Thread Arun karthikeyan
Hi there, In my table having 4 fields.That is _id__|Link_ datano___name| 1 | jsg/jm/c=us&js |Mar 24|__Katik 2 | jsg/jm/c=eu&js |Mar 24|__Katik 32| jsg/jm/c=us&js |Mar 25|__Katik 12|

[php-list] MYSQL query NOT in database

2007-02-17 Thread Gordon Stewart
WHERE `field` = 'words' Hi, I know how to do mysql queries where the "words" DOES appear in the field "field"... However, is there a way to do a MYSQL query to EXCLUDE anything ?? IE... I want to search the field "fieldname" where it brings up ALL valuesEXCEPT where the word/phrease "notwanted"

Re: [php-list] MYSQL & TIME function

2007-02-10 Thread Gordon Stewart
On 2/11/07, Pete <[EMAIL PROTECTED]> wrote: > >$query ="SELECT timetext, Time, groupa, country, value FROM_UNIXTIME(Time) > > FROM membercount t1 WHERE Time = (SELECT MAX(Time) FROM membercount t2 WHERE > > Comma after value? Thanks, its "going" - However that only gives me 2 values - the latest e

Re: [php-list] MYSQL & TIME function

2007-02-10 Thread Pete
In message <[EMAIL PROTECTED]> , Gordon Stewart <[EMAIL PROTECTED]> writes >Hi, > >thanks... > >though I'm getting an error :- > >Code :- > >$query ="SELECT timetext, Time, groupa, country, value FROM_UNIXTIME(Time) > FROM membercount t1 WHERE Time = (SELECT MAX(Time) FROM membercount t2 WHERE Com

Re: [php-list] MYSQL & TIME function

2007-02-10 Thread Gordon Stewart
Hi, thanks... though I'm getting an error :- Code :- $query ="SELECT timetext, Time, groupa, country, value FROM_UNIXTIME(Time) FROM membercount t1 WHERE Time = (SELECT MAX(Time) FROM membercount t2 WHERE FROM_UNIXTIME(t1.Time, '%Y-%m-%d') = FROM_UNIXTIME(t2.Time, '%Y-%m-%d'))"; (timetext -

Re: [php-list] MYSQL & TIME function

2007-02-08 Thread Rajesh Kumar
Gordon Stewart wrote: > if I have > > Sat 15th 1 a.m, name1, 12 > Sat 15th 7 a.m, name1, 12 > Sat 15th 1 p.m, name1, 14 > Sat 15th 7:p.m, name1, 14 > Sun 16th 1:a.m, name1, 15 > Sun 16th 7:a.m, name1, 16 > Sun 16th 1:p.m, name1, 18 > Sun 16th 7:p.m, name1, 18 > Mon 17th 1 a.m., name1, 19 > > (i'

[php-list] MYSQL & TIME function

2007-02-08 Thread Gordon Stewart
Hi there, im thinking of doing a new MYSQL database and have a small MYSQL query, that (if possible) could be answered before I start... Basically, I'll have 3 fields time, name, value The "time" field will contain the value of the time() function, & the database will be updated / added to

[php-list] mysql query

2007-02-05 Thread digvijay kumar
- Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers. [Non-text portions of this message have been removed]

[php-list] MYSQL order Distinct ?

2007-01-30 Thread Gordon Stewart
Hi there, I currently have this (working) MYSQL Query :- $query="SELECT * FROM tablename WHERE (`groupa` = '$group') ORDER BY montha DESC, filea DESC LIMIT $limita"; Basically $limita is a number - EG 100, 200 etc... - & works well.. Ive got another field called datea EG :- "30th January" etc...

Re: [php-list] MySQL question

2007-01-13 Thread Pete
In message <[EMAIL PROTECTED]>, Pete <[EMAIL PROTECTED]> writes >In message <[EMAIL PROTECTED]>, Pete <[EMAIL PROTECTED]> >writes >>I tried this, because I have something similar that I need - "show me >>the next and previous record WHERE... " >> >>But I can't get your example to work, I get the er

Re: [php-list] MySQL question

2007-01-13 Thread Pete
In message <[EMAIL PROTECTED]>, Pete <[EMAIL PROTECTED]> writes >I tried this, because I have something similar that I need - "show me >the next and previous record WHERE... " > >But I can't get your example to work, I get the error message >"Incorrect usage of UNION and ORDER BY" > >The full SQL c

Re: [php-list] MySQL question

2007-01-13 Thread Pete
In message <[EMAIL PROTECTED]>, James Keeline <[EMAIL PROTECTED]> writes >--- Emily Berk <[EMAIL PROTECTED]> wrote: > >> Let's say I have a set of records and I want to retrieve the first and the >> last (ordered by, say, the value of one of the columns). >> >> Is there >> >> To get either the f

Re: [php-list] MySQL question

2007-01-10 Thread Emily Berk
Cool! Thank you. At 10:58 AM 1/10/2007 -0800, James Keeline wrote: >--- Emily Berk <[EMAIL PROTECTED]> wrote: > >> Let's say I have a set of records and I want to retrieve the first and the >> last (ordered by, say, the value of one of the columns). >> >> Is there >> >> To get either the first

Re: [php-list] MySQL question

2007-01-10 Thread James Keeline
--- Emily Berk <[EMAIL PROTECTED]> wrote: > Let's say I have a set of records and I want to retrieve the first and the > last (ordered by, say, the value of one of the columns). > > Is there > > To get either the first or the last, I'm assuming I would > > Select * order by columnX ASC LIMIT 1

[php-list] MySQL question

2007-01-10 Thread Emily Berk
Let's say I have a set of records and I want to retrieve the first and the last (ordered by, say, the value of one of the columns). Is there To get either the first or the last, I'm assuming I would Select * order by columnX ASC LIMIT 1 and to get the last I'd order descending. But how woul

Re: [php-list] MySQL wait 30 second, after that query will execute the command

2006-11-27 Thread Paul Menard
27, 2006 3:40:21 AM Subject: [php-list] MySQL wait 30 second, after that query will execute the command Dear All, I have problem with my MYSQL v5.0 today, for Command Select is very fast, but for the command UPDATE it's take time, Mysql will take 30 secon

[php-list] MySQL wait 30 second, after that query will execute the command

2006-11-27 Thread Suwandi
Dear All, I have problem with my MYSQL v5.0 today, for Command Select is very fast, but for the command UPDATE it's take time, Mysql will take 30 second (Sleep mode), after that, the query (Update) will be execute. Look like very strange. I have check the system, there is idle/no have activity,

Re: [php-list] MYSQL - Select XX Months

2006-11-25 Thread Pete
In message <[EMAIL PROTECTED]> , Gordon Stewart <[EMAIL PROTECTED]> writes >Hi there, > >I have a database set up, with one of the fields is a month - > >"200611" = November 2006 >"200610" = October 2006 >"200609" = September 2006 > >I was wondering, I know how to sort descending etc.. - Is there a

Re: [php-list] MYSQL - Select XX Months

2006-11-25 Thread Bob
- Original Message - From: Gordon Stewart I have a database set up, with one of the fields is a month - "200611" = November 2006 "200610" = October 2006 "200609" = September 2006 I was wondering, I know how to sort descending etc.. - Is there a way, to (add to an existing search criteri

[php-list] MYSQL - Select XX Months

2006-11-25 Thread Gordon Stewart
Hi there, I have a database set up, with one of the fields is a month - "200611" = November 2006 "200610" = October 2006 "200609" = September 2006 I was wondering, I know how to sort descending etc.. - Is there a way, to (add to an existing search criteria).. select all records in the last XX mo

[php-list] mySQL and Dreamweaver...please help!

2006-11-15 Thread Rafael
I have over 4,000 products in mySQL database, and I've successfully connected to mySQL in Dreamweaver. My product database, includes description of the product, price, image name of the products, etc. Obviously I don't want to copy and paste every single product image, description, price, on my sit

Re: [php-list] MYSQL statement help

2006-11-06 Thread James Keeline
--- Lenny Davila <[EMAIL PROTECTED]> wrote: > it works fine like this: > > echo myCount('bands','1','type','promoter','=','Promoters'); > > but this will not: > > $theDate = date("Ymd"); > > echo myCount('calendar','1','mydate','$theDate','>=','Events'); > > the sql statement comes out like t

[php-list] MYSQL statement help

2006-11-06 Thread Lenny Davila
I have a function to count how many rows in various tables. function myCount($table,$where,$data,$type,$is,$name) { global $theDate; if ($where == 1) { $mysql = "SELECT COUNT(*) FROM `$table` WHERE `$data` $is '$type'";

Re: [php-list] MYSQL update error.

2006-10-04 Thread James Keeline
--- Gordon Stewart <[EMAIL PROTECTED]> wrote: > ("UPDATE Yahoogroup SET `Status`='2', `date`='12 Apr 2006 15:25:03', > `email`='[EMAIL PROTECTED]', `subject`='Re: [Groupname] > Rail Use Surges', `modemail`='', > `webread`='0', `IP`='123.4.56.789' WHERE (`month`='200604' and > `group`='group' and

[php-list] MYSQL update error.

2006-10-04 Thread Gordon Stewart
("UPDATE Yahoogroup SET `Status`='2', `date`='12 Apr 2006 15:25:03', `email`='[EMAIL PROTECTED]', `subject`='Re: [Groupname] Rail Use Surges', `modemail`='', `webread`='0', `IP`='123.4.56.789' WHERE (`month`='200604' and `group`='group' and `file`='1')") Hi, (Ive changed the email / name of the

[php-list] MYSQL: Unique field insert accross 3 fields

2006-09-23 Thread Gordon Stewart
Hi, i have a table.. with 7-8 fields... Now, 3 of my fields, I want to be unique, however no INDIVIDUAL field will be unique... IE I can have values Smith, 7, 8, (& extra fields here...) Smith, 7, 5, (& extra fields here...) Smith, 6, 5, (& extra fields here...) Smith, 6, 3, (& extra fields here

[php-list] MYSQL Query question

2006-08-30 Thread Gordon Stewart
I am on a server with a limit of 72,000 queries per hour.. If I have a script running as a cronjob / Scheduled task, every 5 minutes, is it safe to do the following :- while ($x<100){ $query = "INSERT INTO Events VALUES ('',$text)"; $result=mysql_query($query) or die( "Unable to view data\n" . m

Re: [php-list] MYSQL

2006-07-22 Thread Prinze Adam
Thank you Phill Phill Sparks <[EMAIL PROTECTED]> wrote: It's often good practice with multiple tables to reference them when Yahoo! Groups Sponsor ~--> Great things are happening at Yahoo! Groups. See the new email design. http://us.cli

Re: [php-list] MYSQL

2006-07-21 Thread Phill Sparks
It's often good practice with multiple tables to reference them when you refer to the fields also, eg table1.field1, table2.field3, e.t.c.; I'm not sure whether the brackets are needed, or indeed in the right place however the rest looks okay. With MySQL it may be useful to note that... SELECT f

[php-list] MYSQL

2006-07-21 Thread Prinze Adam
Hello, Is this the right way to join 4 tables? SELECT f1, f2, f3, f4 FROM ( ( FIRST LEFT JOIN SECOND ON idf1= idf2 ) LEFT JOIN third ON idf2= idf3 ) LEFT JOIN fourth ON idf2 = idf4 LIMIT 30 - Yahoo! Music Unlimited - Access ove

Re: [php-list] Mysql Insert Problem

2006-07-17 Thread Patrick Bierans
27;Players','fname,lname,address,city,state,zip,phhome,phcell,phwork,other,email',$_POST) tht ----- Original Message - From: "Wade Smart" <[EMAIL PROTECTED]> To: Sent: Tuesday, July 04, 2006 1:24 AM Subject: [php-list] Mysql Insert Problem > 07032006 1818 GMT-6 &

Re: Re: Re: [php-list] Mysql Insert Problem

2006-07-17 Thread Phill Sparks
Oh, and the error before then was becuase you had not put quotes around the values in your query, not just the whole query; i.e., ... "VALUES ('Bob', 'Smith', '123 On Some Street'"... On 06/07/06, Phill Sparks <[EMAIL PROTECTED]> wrote: > There's a comma (,) after phhome and again after the phone

Re: [php-list] Mysql Insert Problem

2006-07-17 Thread Pete
In message <[EMAIL PROTECTED]>, Wade Smart <[EMAIL PROTECTED]> writes >07052006 1845 GMT-6 > >Im still having a bit of a problem with this insert. > >Im using the double quotes but this is the error: > >Players(fname,lname,address,city,state,zip,phhome,) >VALUES (Bob,Smith,123 On Some Street, Ba

Re: Re: [php-list] Mysql Insert Problem

2006-07-17 Thread Phill Sparks
There's a comma (,) after phhome and again after the phone number. this is the cause of the error. There should be another field, or no comma. On 06/07/06, Wade Smart <[EMAIL PROTECTED]> wrote: > > > > > > > 07052006 1845 GMT-6 > > Im still having a bit of a problem with this insert. > > Im usi

Re: [php-list] Mysql Insert Problem

2006-07-06 Thread Wade Smart
07062006 0543 GMT-6 $player_data = array(); $search_terms = array('fname', 'lname', 'address', 'city', 'state', 'zip', 'phhome', 'phcell', 'phwork', 'email', ); foreach($searc

Re: [php-list] Mysql Insert Problem

2006-07-05 Thread Mike Brandonisio
Hi, I looked at what I sent you and missed a quote on line 3. It was "VALUES ('; and should have been "VALUES (";. See below $query = "INSERT INTO Players (fname, lname, address, city, state, zip, phhome, phcell, phwork, other, email)"; $query .="VALUES ("; $query .=" '".$_POST['fname']."', '".

Re: [php-list] Mysql Insert Problem

2006-07-05 Thread Wade Smart
07052006 1845 GMT-6 Im still having a bit of a problem with this insert. Im using the double quotes but this is the error: Players(fname,lname,address,city,state,zip,phhome,) VALUES (Bob,Smith,123 On Some Street, Batesville, OG, 01235, 333-222-,) Insert error: "You have an error in your S

Re: [php-list] Mysql Insert Problem

2006-07-03 Thread Mike Brandonisio
Hi, You need to encapsulate your data in quotes. I would have done it like this with double quotes, single quote passed to query. $query = "INSERT INTO Players (fname, lname, address, city, state, zip, phhome, phcell, phwork, other, email)"; $query .="VALUES ('; $query .=" '".$_POST['fname'].

[php-list] Mysql Insert Problem

2006-07-03 Thread Wade Smart
07032006 1818 GMT-6 I have this insert statement that Im working with and Im getting an error that says... "You have an error in you SQL syntax near 'Revere Street'. That is the address. Oddly, it took off the numbers of the street. Is inserting into a varchar thats 20 in size, more than enough.

Re: [php-list] MYSQL select from same table ? twice ?

2006-05-25 Thread Gordon Stewart
On 5/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > $sql2="SELECT * FROM table WHERE $txt"; > > Hope it helps, Riquez Thanks - You helped a lot.. It does work... -- G Yahoo Archives by email = Yes http://groups.kwister.com/owners.php#add NZ community groups - [EMAIL PROTECTED] C

Re: [php-list] MYSQL select from same table ? twice ?

2006-05-25 Thread riquez
On 25 May 2006, at 18:48, Gordon Stewart wrote: > On 5/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Then a second SELECT fetching all the records where the  > Reference# is > > in your array. > > How do you do this part ? - i thought about it... > > An initial thought would be :-

Re: [php-list] MYSQL select from same table ? twice ?

2006-05-25 Thread Gordon Stewart
On 5/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Then a second SELECT fetching all the records where the Reference# is > in your array. How do you do this part ? - i thought about it... An initial thought would be :- $query="select BATCHID, AuthorisedID, Status FROM BatchAuth where

Re: [php-list] MYSQL select from same table ? twice ?

2006-05-25 Thread riquez
On 24 May 2006, at 19:57, Gordon Stewart wrote: > Ive got a table, where the columns / fields A & B are what im  > selecting > > Column A, is a reference, > Column B - is a Username... > > There could be multiple references to a username... > 1 john > 3 john > 7 john > > and also, multiple use

[php-list] MYSQL query command : Last night

2006-05-24 Thread [EMAIL PROTECTED]
re my email last night (home) - re the MYSQL query wanting to find the usernames for more than one reference. After I went to bed, i thought of a way to do it - but not via a query / MYSQL command... (hourly save to a text-file, then do loops...) If its possible to do the MYSQL command - then

[php-list] MYSQL select from same table ? twice ?

2006-05-24 Thread Gordon Stewart
Ive got a table, where the columns / fields A & B are what im selecting Column A, is a reference, Column B - is a Username... There could be multiple references to a username... Eg 1 john 3 john 7 john and also, multiple usernames per reference EG 3 John 3 Jane 3 Sam My question, - I

[php-list] mysql optimisation

2006-05-24 Thread star moon
Can any body tell me how this query optimise?  SQL-query: EXPLAIN SELECT db.banner_id, db.banner_image, db.banner_url, db.top_banner AS TOP, dp.top_banner FROM dia_banner db, dia_page_name dp WHERE db.page_id = dp.page_id AND dp.status =1 AND dp.page_name = 'Table Talk' AND FIND_IN_SET( 'T', db.

Re: [php-list] MYSQL Update

2006-05-22 Thread Gordon Stewart
On 5/21/06, Sudhir <[EMAIL PROTECTED]> wrote: >   please check the table field "BatchID" if this is primary key then no need to insert that data in this field < The problem is solved - Was using ` (backticks) - rather than normal quotes - ' -- G Yahoo Archives by email = Yes http://groups.kw

Re: [php-list] MYSQL Update

2006-05-21 Thread Sudhir
  please check the table field "BatchID" if this is primary key then no need to insert that data in this field   Gordon Stewart <[EMAIL PROTECTED]> wrote:   $query="INSERT INTO `BatchID` ( `KID` , `BATCHID` , `Email` , `Title` , `Region` , `City` , `Address` , `ViewStatus` , `UpdateStatus`)

Re: [php-list] MYSQL Update

2006-05-21 Thread Mike Brandonisio
Hi, You do not use back ticks in the values. They should be single  quotes. See [EMAIL PROTECTED] response. Sincerely, Mike -- Mike Brandonisio  *    Web Hosting Tech One Illustration *    Internet Marketing tel (630) 759-9283    *    e-Commerce [EMAIL PROTECTED]    *    http

Re: [php-list] MYSQL Update

2006-05-21 Thread riquez
On 21 May 2006, at 15:40, Gordon Stewart wrote: > $query="INSERT INTO `BatchID` ( `KID` , `BATCHID` , `Email` , `Title` > , `Region` , `City` , `Address` , `ViewStatus` , `UpdateStatus`) > VALUES (`$name`,``, ``, `$title`, `$region`, `$suburb`, `$address`, > `$view`, `$update`)"; > $result=mysq

[php-list] MYSQL Update

2006-05-20 Thread Gordon Stewart
$query="INSERT INTO `BatchID` ( `KID` , `BATCHID` , `Email` , `Title` , `Region` , `City` , `Address` , `ViewStatus` , `UpdateStatus`) VALUES (`$name`,``, ``, `$title`, `$region`, `$suburb`, `$address`, `$view`, `$update`)"; $result=mysql_query($query) or die( "Unable to add data\n" . mysql_erro

Re: [php-list] Mysql - Error - Server error

2006-05-11 Thread Pete
In message <[EMAIL PROTECTED]> , Gordon Stewart <[EMAIL PROTECTED]> writes >On 5/11/06, Pete <[EMAIL PROTECTED]> wrote: > >> while (list( $ver, $email1, $data1ac, $data1ad)=$mysql_fetch_array >> ($result){ >>    echo "$ver : $email1 : $data1ac : $data1ad "; >> } > > >Yep, - Apart from a miss

Re: [php-list] Mysql - Error - Server error

2006-05-11 Thread Gordon Stewart
On 5/11/06, Pete <[EMAIL PROTECTED]> wrote: > while (list( $ver, $email1, $data1ac, $data1ad)=$mysql_fetch_array > ($result){ >    echo "$ver : $email1 : $data1ac : $data1ad "; > } Yep, - Apart from a missing ) before the { - & removing the $ from mysql_fetch_array - it works perfectly -

Re: [php-list] Mysql - Error - Server error

2006-05-11 Thread Pete
In message <[EMAIL PROTECTED]> , Gordon Stewart <[EMAIL PROTECTED]> writes >$num=mysql_numrows($result); > >echo "NUMBER OF RECORDS - $num\n"; > >$i=0; > >while ($i < $num) { > >$ver=mysql_result($result,$i,"Verified") or die( "Unable to view >data1aa - \n" . mysql_error()); >echo "VERIFIED - '$

[php-list] Mysql - Error - Server error

2006-05-11 Thread Gordon Stewart
I've sucessfully opened a MYSQL database  & trying to list / loop through the records, however I'm getting this error :- Unable to view data1aa The code is :- == $num=mysql_numrows($result); echo "NUMBER OF RECORDS - $num\n"; $i=0; while ($i < $num) { $ver=mysql_

[php-list] MySQL Update not working.

2006-03-10 Thread libertyhosting
Hi All, I cannot seem to figure out this one. I have the following php code in a form: When the form is posted, it runs the update_cart function (see below) to update the cart contents for each item. When I echo the for loop it returns the right paramaters, but when I run the UPDATE SQL state

[php-list] MySQL (again)

2006-01-12 Thread Marc Boncz
Hi all, Still struggling with this new MySQL installation, having problems again... MySQL 4.1 has much more character set options than 3.23, but this also generates some confusion: Both in Delphi and in PHP appplications I used to have blocks of statements like this: BEGIN; STATEMENT 1; STATEMEN

Re: [php-list] MySQL/Windows installation question...

2006-01-10 Thread Gurvinder Bharya
Hallo Marc, I sympathize with ya!!! The version of MySQL you are using has quite a number of bugs and even if i was to give you the solution, you would still end up with more problems. What i would recommend is do away with the mysql you are using and start using the most stable of mysqls

[php-list] MySQL/Windows installation question...

2006-01-10 Thread Marc Boncz
Hi all, Just upgraded MySQL on my development machine to 4.1 and get the familiar error "Client does not support authentication protocol...". A bit of Googling learns this is expected behaviour and all clients in use should be instructed to use the new protocol (including PHP). However, on none of

Re: [php-list] MYSQL command

2005-07-26 Thread Paul Menard
What version of MySQL are you using? You may be able to solve this by using a nested query. http://dev.mysql.com/doc/mysql/en/subqueries.html Also I was confused about what you are attempting to pull from the DB. I see where you wrote '...Ie if theres more than 1 author, it lists 2 sets of data

[php-list] MYSQL command

2005-07-26 Thread Gordon Stewart
$query="SELECT * FROM Books,Master,Author,Publisher WHERE Master.Author=\"$author\" AND (Master.ISBN=Books.ISBN) AND (Author.ID=Master.Author) AND(Publisher.Unique=Books.Publisher)"; Hi, Obviously im doing a book catalogue site - & everything works ok... However - I'm wanting to list the book

  1   2   >