Re: [PHP] php/mysql Query Question.

2009-09-16 Thread admin
I tend to do this robert, while looking at your example i thought to myself since i am trying to mimick a shell command why not run one. Result: ? $db = 'db'; $host = 'host'; $user = 'user'; $pass = 'pass'; $query = select * from $db.my_table; $ddvery = shell_exec(mysql -u$user -p$pass --html

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: I tend to do this robert, while looking at your example i thought to myself since i am trying to mimick a shell command why not run one. Result: ? $db = 'db'; $host = 'host'; $user = 'user'; $pass = 'pass'; $query = select * from $db.my_table; $ddvery =

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread Jim Lucas
ad...@buskirkgraphics.com wrote: Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shellmysql -uyourmom -plovesme --html This now will return

[PHP] php/mysql Query Question.

2009-09-15 Thread admin
Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shellmysql -uyourmom -plovesme --html This now will return all results in an html format from all

Re: [PHP] php/mysql Query Question.

2009-09-15 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shellmysql -uyourmom -plovesme --html This now will return all

Re: [PHP] php/mysql Query Question.

2009-09-15 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: Would you mind giving me an example of this that i can stick right into a blank php file and run. I get what you are saying but i cant seem to make that even echo out the data. php 5.2 mysql 5.1.3 Apache 2.2 ?php $db = 'db'; $host = 'host'; $user =

[PHP] php - mysql query issue

2006-09-15 Thread Dave Goodchild
Hi all. I am building an online events listing and when I run the following query I get the expected result set: SELECT events.id AS eventid, name, postcode, start_time, dates.date FROM events, dates_events, dates WHERE dates_events.event_id = events.id and dates_events.date_id = dates.id AND

Re: [PHP] php - mysql query issue

2006-09-15 Thread Brad Bonkoski
Have you tried echoing out your query to run on the backend itself? Maybe there is some problem with how your join is being constructed... Perhaps a left outer join is called for? Hard to tell without having knowledge of your table structure and table data... -B Dave Goodchild wrote: Hi all.

Re: [PHP] php - mysql query issue

2006-09-15 Thread Dave Goodchild
On 15/09/06, Brad Bonkoski [EMAIL PROTECTED] wrote: Have you tried echoing out your query to run on the backend itself? Maybe there is some problem with how your join is being constructed... Perhaps a left outer join is called for? Hard to tell without having knowledge of your table structure

Re: [PHP] php - mysql query issue

2006-09-15 Thread Andrei
Also you should check if dates.date is a DATE type, not DATETIME. Lost some time on that when I wanted to select enregs for a specific date, field was DATETIME and I was querying `date` = '2006-01-01'... :p Andy Dave Goodchild wrote: On 15/09/06, Brad Bonkoski [EMAIL PROTECTED]

Re: [PHP] php - mysql query issue

2006-09-15 Thread Richard Lynch
On Fri, September 15, 2006 7:35 am, Dave Goodchild wrote: Hi all. I am building an online events listing and when I run the following query I get the expected result set: Any ideas why not? I know it's more of a mySQL question so apologies in advance! Well, you'd have to tell us what's in

[PHP] php, mySQL query character problem

2004-09-22 Thread Victor C.
Hi, I have a query to mysql basically saying: $query = select * from table1 where colum1 like '$email%'; //where $email is defined string. When i echo $query, I get the string : select * from table 1 where colum1 like 'testdata%' If i copy paste the string into phpMyAdmin SQL, the

RE: [PHP] php, mySQL query character problem

2004-09-22 Thread Jay Blanchard
[snip] $query = select * from table1 where colum1 like '$email%'; $returnValue = QueryDatabase($query); echo mysql_num_rows($returnValue); I always get 0 for the # of records. [/snip] You have not included the code from your QueryDatabase

Re: [PHP] php, mySQL query character problem

2004-09-22 Thread Curt Zirzow
* Thus wrote Victor C.: If i copy paste the string into phpMyAdmin SQL, the query executes successfully and returns one record. However, when I just do$returnValue = QueryDatabase($query); echo

[PHP] PHP - mySQL query question

2004-07-25 Thread Karl-Heinz Schulz
I have a simple question (not for me). Why does this query does not work? $links_query = mysql_query(select id, inserted, title, information, international from links WHERE international = y; order by inserted desc LIMIT 0 , 30); The information for the international fields are: Field:

Re: [PHP] PHP - mySQL query question

2004-07-25 Thread John W. Holmes
Karl-Heinz Schulz wrote: I have a simple question (not for me). Why does this query does not work? $links_query = mysql_query(select id, inserted, title, information, international from links WHERE international = y; order by inserted desc LIMIT 0 , 30); The information for the

Re: [PHP] PHP - mySQL query question

2004-07-25 Thread Jason Davidson
single quote 'y' Jason On Sun, 25 Jul 2004 11:05:23 -0400, Karl-Heinz Schulz [EMAIL PROTECTED] wrote: I have a simple question (not for me). Why does this query does not work? $links_query = mysql_query(select id, inserted, title, information, international from links WHERE

Re: [PHP] PHP - MySQL Query...

2003-08-14 Thread Marcus Edvardsson
I'm used to do like this: $query = 'SELECT * FROM cities'; $result = mysql_query($query); if($row = mysql_fetch_array($result)) do { echo ('tr td class=city' . $row[0] . ', ' . $row[1] . '/td td' . $row[2] . '/td td' . $row[3] . /td /tr\n); } while ($row = mysql_fetch_array($result));

Re: [PHP] PHP - MySQL Query...

2003-08-14 Thread Ivo Fokkema
This is not true, the resource link identifier is optional! If unspecified, the last opened link is used. My suggestion is to check the results of mysql_error() for more information on the failed query. HTH, Ivo Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] $dbh

RE: [PHP] PHP - MySQL Query...

2003-08-14 Thread Jay Blanchard
[snip] This is not true, the resource link identifier is optional! If unspecified, the last opened link is used. My suggestion is to check the results of mysql_error() for more information on the failed query. [/snip] You are right, of course...my sleepy brain just glanced at the code and fired

Re: [PHP] PHP - MySQL Query...

2003-08-14 Thread Curt Zirzow
* Thus wrote Steven Kallstrom ([EMAIL PROTECTED]): Hello all... I'm embarrassed by this one... I think it should work but it isn't... $query = 'SELECT * FROM cities'; $result = mysql_query($query); while ($row = mysql_fetch_row($result)) { getting this error:

Re: [PHP] PHP - MySQL Query...

2003-08-14 Thread murugesan
Try this, $result = mysql_query($query,$dbh); -Murugesan - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: Steven Kallstrom [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Thursday, August 14, 2003 4:50 PM Subject: RE: [PHP] PHP - MySQL Query... [snip] $dbh

[PHP] PHP - MySQL Query...

2003-08-14 Thread Steven Kallstrom
Hello all... I'm embarrassed by this one... I think it should work but it isn't... $dbh = mysql_connect(localhost, login, password) or die('cannot connect to the database because: ' . mysql_error()); mysql_select_db(database); $query = 'SELECT * FROM cities'; $result =

Re: [PHP] PHP - MySQL Query...

2003-08-14 Thread Michael A Smith
Steven Kallstrom wrote: Hello all... I'm embarrassed by this one... I think it should work but it isn't... $dbh = mysql_connect(localhost, login, password) or die('cannot connect to the database because: ' . mysql_error()); mysql_select_db(database); $query = 'SELECT * FROM cities';

RE: [PHP] PHP - MySQL Query...

2003-08-14 Thread Jay Blanchard
[snip] $dbh = mysql_connect(localhost, login, password) or die('cannot connect to the database because: ' . mysql_error()); mysql_select_db(database); $query = 'SELECT * FROM cities'; $result = mysql_query($query); while ($row = mysql_fetch_row($result)) { echo ('tr td

[PHP] PHP/MySQL Query

2002-12-15 Thread Steven M
How do i make a form that will allow me to add 2 to the value of a MySQL field? I am trying to change it from 75 to 77. Is this possible? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP/MySQL Query

2002-12-15 Thread Leif K-Brooks
mysql_query(update table set field=field+1 where whatever='whatever'); Steven M wrote: How do i make a form that will allow me to add 2 to the value of a MySQL field? I am trying to change it from 75 to 77. Is this possible? Thanks -- The above message is encrypted with double rot13

Re: [PHP] PHP/MySQL Query

2002-12-15 Thread Steven M
Leif Many thanks for that, your help is much appreciated. *smiles* Steven M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP/MYSQL query error

2002-08-26 Thread Chris Crane
I am getting a failed query error message. Could someone take a look and let me know. //F U N C T I O N S //= function AddSignupRequest($Signup_FName, $Signup_LName, $Signup_Address1, $Signup_Address2, $Signup_City, $Signup_State, $Signup_Zip, $Signup_Email, $Signup_Phone,

RE: [PHP] PHP/MYSQL query error

2002-08-26 Thread Jay Blanchard
[snip] /* Performing SQL query */ $query = INSERT INTO SignupRequests ('FirstName', 'LastName', 'Address1', 'Address2', 'City', 'State', 'Zip', 'Email', 'Phone', 'ContactMethod', 'Date', 'IP', 'Status', 'Comments') VALUES ('', 'Chris', 'Crane', '655 Talcottville Road', 'Apt.

Re: [PHP] PHP/MYSQL query error

2002-08-26 Thread Chris Crane
Initially there was an error with too many values verses columns. But I think it was fixed. I am double checking now. Jay Blanchard [EMAIL PROTECTED] wrote in message 003201c24d07$b8560470$8102a8c0@000347D72515">news:003201c24d07$b8560470$8102a8c0@000347D72515... [snip] /* Performing SQL

Re: [PHP] PHP/MYSQL query error

2002-08-26 Thread Chris Crane
There are 15 columns and 15 pieces of data. In my second post I fixed this error and pasted it into PHPMYADMIN and it worked fine, but not here... Chris Crane [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Initially there was an error with too many values

Re: [PHP] PHP/MYSQL query error

2002-08-26 Thread Justin French
Why don't you do $result = mysql_query($query) or die(mysql_error()); or $result = mysql_query($query); echo mysql_error(); That way, instead of Query Failed you'll get something meaningful... probably something that will solve the problem. Justin French on 26/08/02 11:55 PM, Chris Crane

Re: [PHP] PHP/MYSQL query error

2002-08-26 Thread Chris Crane
Thank you. I will try that. Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why don't you do $result = mysql_query($query) or die(mysql_error()); or $result = mysql_query($query); echo mysql_error(); That way, instead of Query Failed you'll

Re: [PHP] PHP/MYSQL query error

2002-08-26 Thread Chris Crane
I got it working. It did not like the single quotes around the column names. Chris Crane [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thank you. I will try that. Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

[PHP] PHP/MySQL Query Prob

2002-04-15 Thread Jason Soza
Hey... new to the list, but didn't have time to lurk and watch the traffic, kind of in a bind here. I apologize in advance if I do something wrong... Using this code: ?php $link = mysql_connect() or die(Could not connect);

[PHP] PHP/mySQL query problem...

2001-08-27 Thread Jeff Lewis
Guys, why isn't this working? :) SELECT * FROM links WHERE name LIKE %te% OR description LIKE %te% OR url LIKE %te% AND approved=1 LIMIT 5 I am using a PHP script to add items to the database and a small search file to grab them. Thing is, I want the above to grab ONLY ones that have

Re: [PHP] PHP/mySQL query problem...

2001-08-27 Thread ERISEN, Mehmet Kamil
Yes, there is a problem. -- SELECT * FROM links WHERE 1=1 and ( name LIKE %te% OR description LIKE %te% OR url LIKE %te% ) AND approved=1 LIMIT 5; -- --- Jeff Lewis [EMAIL PROTECTED] wrote: Guys, why isn't this working? :) SELECT * FROM links WHERE name LIKE %te% OR description LIKE

[PHP] PHP/mySQL Query....

2001-07-19 Thread Jeff Lewis
Ok, using PHP and mySQL have two tables that look something like this; Table 1 (users): userID location Table 2 (resumes): resumeID userID I am trying to form a query to pull all the locations and list them on the page. While I could only just select from the users one I do want to be able

RE: [PHP] PHP/mySQL Query....

2001-07-19 Thread King, Justin
: [PHP] PHP/mySQL Query Ok, using PHP and mySQL have two tables that look something like this; Table 1 (users): userID location Table 2 (resumes): resumeID userID I am trying to form a query to pull all the locations and list them on the page. While I could only just select from the users one I

Re: [PHP] PHP/mySQL Query....

2001-07-19 Thread Jeff Lewis
Yes but for the first query all I want to do is list the locations and not multiple times Jeff - Original Message - From: King, Justin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:46 PM Subject: RE: [PHP] PHP/mySQL Query I'm assuming you're trying

RE: [PHP] PHP/mySQL Query....

2001-07-19 Thread King, Justin
Whoops.. do SELECT DISTINCT -Justin -Original Message- From: Jeff Lewis [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:08 PM To: King, Justin; [EMAIL PROTECTED] Subject: Re: [PHP] PHP/mySQL Query Yes but for the first query all I want to do is list the locations

[PHP] PHP/mySQL Query

2001-07-05 Thread Jeff Lewis
I fought the urge to post this here but have to :( I have two tables named like this: owners -ownerID -teamname -more fields teampages -ownerID -bio Anyway, I'm doing a select on the database like this: select ownerID, last_update FROM teampages ORDER BY last_update DESC LIMIT 10 The thing

Re: [PHP] PHP/mySQL Query

2001-07-05 Thread Jay Paulson
Message - From: Jeff Lewis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 05, 2001 6:59 PM Subject: [PHP] PHP/mySQL Query I fought the urge to post this here but have to :( I have two tables named like this: owners -ownerID -teamname -more fields teampages -ownerID -bio

Re: [PHP] PHP/mySQL Query

2001-07-05 Thread Duncan Hill
On Thu, 5 Jul 2001, Jeff Lewis wrote: owners -ownerID -teamname -more fields teampages -ownerID -bio Anyway, I'm doing a select on the database like this: select ownerID, last_update FROM teampages ORDER BY last_update DESC LIMIT 10 The thing is, I want to get the team name from the

RE: [PHP] PHP/mySQL Query

2001-07-05 Thread Chadwick, Russell
SELECT t.ownerID, t.last_update, o.teamname FROM teampages t, owners o WHERE t.ownerID = o.ownerID ORDER BY t.last_update DESC LIMIT 10 -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 05, 2001 5:00 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP/mySQL

Re: [PHP] PHP/mySQL Query

2001-07-05 Thread Steve Werby
Jeff Lewis [EMAIL PROTECTED] wrote: I fought the urge to post this here but have to :( owners -ownerID -teamname -more fields teampages -ownerID -bio Anyway, I'm doing a select on the database like this: select ownerID, last_update FROM teampages ORDER BY last_update DESC LIMIT 10

RE: [PHP] PHP Mysql query data conversion newbie

2001-05-10 Thread Don Read
On 09-May-01 Jon Haworth wrote: snip be sure to check for the NULL : if (isset($amyrow[date])) { if ($amyrow[date] == -00-00 00:00:00) { echo no date; } else { echo $amyrow[date]; } } else {

[PHP] PHP Mysql query data conversion newbie

2001-05-09 Thread Andras Kende
Hello, I pull some data from mysql with the php code below. On the date field if there is no date on mysql it displays : -00-00 00:00:00 I would like to change this -00-00 00:00:00 to no date for example.. Or if the cel is empty to (because otherwise the tableborders are messed up)

RE: [PHP] PHP Mysql query data conversion newbie

2001-05-09 Thread Jon Haworth
[date]; } echo /td; } } HTH Jon -Original Message- From: Andras Kende [mailto:[EMAIL PROTECTED]] Sent: 28 April 2001 17:01 To: [EMAIL PROTECTED] Subject: [PHP] PHP Mysql query data conversion newbie Hello, I pull some data from mysql with the php code

Re: [PHP] PHP Mysql query data conversion newbie

2001-05-09 Thread bill
On Sat, 28 Apr 2001, Andras Kende wrote: Hello, I pull some data from mysql with the php code below. On the date field if there is no date on mysql it displays : -00-00 00:00:00 I would like to change this -00-00 00:00:00 to no date for example.. hmm... mysql can do this, works