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
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 =
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
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
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
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 =
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
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.
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
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]
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
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
[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
* 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
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:
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
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
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));
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
[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
* 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:
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
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 =
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';
[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
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
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
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
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,
[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.
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
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
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
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
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]...
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);
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
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
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
: [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
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
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
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
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
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
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
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
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 {
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)
[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
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
51 matches
Mail list logo