The trick is your using the wrong ' instead you need ` ...
go away from kl;-' and go to `-123 ;)
The key above the (Tab) key, or the key next to the number 1 above the q.
so ...
$query=SELECT * FROM bibleverses WHERE `used` = 0 ORDER BY RAND()
LIMIT 1;
When I first learned this also I
used is a column name, if you need to surround it use the back ticks (beow
the esc key, same button as the tilde (~). That is why it fails...it
shouldn't be req'd for the update, though the value may need to be quoted
depending on the col data type
Bastien
From: Ron Piggott [EMAIL PROTECTED]
This is kind of interesting ...
$query=SELECT * FROM quiettimequotation WHERE used = 0 ORDER BY RAND()
LIMIT 1;
works;
$query=SELECT * FROM bibleverses WHERE 'used' = 0 ORDER BY RAND() LIMIT 1;
doesn't! Having the ' around used makes that select command fail --- but
the UPDATE command
I have a table with some relational values, that really saves me on
selects, but gives me a weird error in the insert...
in the DB i have this 2 tables data and categories:
data(
id int
category tinyint ),
categories (
id tinyint
description varchar )
for selects i can use a single query with a
Gabriel B. wrote:
SELECT (@category_id:=id) FROM categories WHERE description = cat1;
REPLACE INTO data VALUES( 10, @category_id);
i send this as a single query in PHP and it returns an error quoting
everything after the first ;
anyidea if i can't send several queries at once? any workaround?
The original message was received at Mon, 20 Jun 2005 17:55:49 +0200
from lists.php.net [114.240.28.128]
- The following addresses had permanent fatal errors -
php-db@lists.php.net
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gabriel B. wrote:
You can't send multiple queries in an SQL statement. You can just
split that in two separates queries. It's not really slower by any
I'm not really concerned about performance. i'm *really* concerned
about race conditions.
I have more than 3mi hits per day. the
Documented research indicate that on Mon, 20 Jun 2005 12:47:56 +0100,
[EMAIL PROTECTED] wrote:
The trick is your using the wrong ' instead you need ` ...
go away from kl;-' and go to `-123 ;)
The key above the (Tab) key, or the key next to the number 1 above the q.
I hope you realise
Hello,
I have a site that allows reporters to enter their articles into a
forum. I am then spilling their articles onto the main page from a
MySQL dbase via a php script, read LATEST ARTICLES.
I am now entering the data myself after they email it to me, however
this is becoming more of a
post your code and db structure, it might be simpler to use an auto
increment value and let the db do the work in assigning the next number...
bastien
From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] auto-generating next id (in order) for an add script
Date: Mon, 20 Jun 2005
Use an autonumber field in MySQL. It will increment automatically every time
you insert a record, and not repeat numbers. No extra PHP code needed. After
the insert query, you can then issue a mysql_insert_id() function that will
return the autonumber field for the last insert, that way you
I'd recommend you use what mysql provides for this. Auto_increment flag.
Here's more information on how to make your id column be an
auto_increment primary key.
http://dev.mysql.com/doc/mysql/en/example-auto-increment.html
- Aman Patel, Sys Admin / Database / Web Devloper, International
Thanks Aman and guy from 'listmail.innovate.net'... I will change my
primarykey ID colum to auto_increment.
I am off to try your suggestions.
Thanks again.
-Original Message-
From: Patel, Aman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Mon, 20 Jun 2005
Thanks Bastien,
I am off to try the auto increment. I will post back if I cannot get it
to work properly.
Again, thanks everyone.
-Original Message-
From: Bastien Koert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; php-db@lists.php.net
Sent: Mon, 20 Jun 2005 13:30:13 -0400
Subject: RE:
This is kind of interesting ...
$query=SELECT * FROM quiettimequotation WHERE used = 0 ORDER BY RAND()
LIMIT 1;
works;
$query=SELECT * FROM bibleverses WHERE 'used' = 0 ORDER BY RAND() LIMIT
1;
doesn't! Having the ' around used makes that select command fail ---
but
the UPDATE command
Depending on your version of MySQL, table type should be MyISAM so that
numbers for deleted articles do not get reused.
Miles Thompson
At 02:33 PM 6/20/2005, [EMAIL PROTECTED] wrote:
Thanks Bastien,
I am off to try the auto increment. I will post back if I cannot get it to
work properly.
Hi there everyone,
I've written a simple forum in PHP for my website (It's an artistic
Jean-Michel Jarre website called Planet Oxygene where I experiment with all
things tech) but I want to add threading to my messages but I'm not sure of
the theory for such a thing.
For example, I know I
On Monday 20 June 2005 04:54 pm, Chris Payne wrote:
For example, I know I need ID, messageid, forumid and messagerootid (Just
example names) but I'm not sure of the theory of how replies to replies etc
... would work in PHP with MySQL? I guess I'm just confused on the whole
threading business
18 matches
Mail list logo