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

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 =

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

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

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

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

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

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]...

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

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

2001-07-19 Thread King, Justin
I'm assuming you're trying to join them and show resumeID also with this SELECT r.resumeID,r.userID,u.location FROM resumes r,users u WHERE r.userID=u.userID; -Original Message- From: Jeff Lewis [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 12:45 PM To: [EMAIL PROTECTED] Subject:

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

Re: [PHP] PHP/mySQL Query

2001-07-05 Thread Jay Paulson
what you want to do is a join so it'd look something like this.. select teampages.ownerID, teampages.last_update, owners.teamname FROM teampages, owners where teampages.ownerID= owners.ownerID ORDER BY teampages.last_update DESC LIMIT 10 hopefully that will work! :) jay - Original

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 {

RE: [PHP] PHP Mysql query data conversion newbie

2001-05-09 Thread Jon Haworth
Well, it's not immediately obvious whether your date is in i, j, or f, so let's pretend it's in date :-) Try this: while($amyrow = mysql_fetch_array($aresult)) { echo /tdtdfont face=verdana size=1; echo $amyrow[i]; echo /tdtdfont face=verdana size=1;

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