I do a mysql request like this one:
SELECT DISTINCT (brand), COUNT( brand )FROM `machines` where category like
'sold' group by brand
I get this from mysql:
brand COUNT( brand)
brandx4
brandy12
how can I echo this result in php?
thanx in advance
Pat
--
Message-
From: p80 [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 13, 2005 4:35 PM
To: php-general@lists.php.net
Subject: [PHP] newbie php/mysql need help
I do a mysql request like this one:
SELECT DISTINCT (brand), COUNT( brand )FROM `machines` where category like
'sold' group by brand
I get
p80 wrote:
I do a mysql request like this one:
SELECT DISTINCT (brand), COUNT( brand )FROM `machines` where category like
'sold' group by brand
Try adding aliases to your query, such as :
SELECT DISTINCT (brand), COUNT (brand) AS brand_count FROM `machines`
WHERE `category` LIKE 'sold' GROUP BY
if one of $titulotxt or $cdstxt is not set, your query will look
something like this:
SELECT * FROM divx WHERE cds like '$cdstxt' ORDER BY titulo
As you see, there is unnecessery . I build my search queries using
this form:
$query_cond='';
foreach($_GET as $col = $val) {
switch($col) {
On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote:
Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and i
want to create an mysql condition... i trying:
$sql1=($titulotxt) ? titulo like '%.$titulotxt.%':;
$sql2=($cdstxt) ?
On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote:
Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and
i
want to create an mysql condition... i trying:
$sql1=($titulotxt) ? titulo like '%.$titulotxt.%':;
into your actual sql statement.
Robbert van Andel
-Original Message-
From: Mr. BuNgL3 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie: PHP/MySQL (SELECT)
Hi...
I'm with a little sintax problem...
The question is that i have two
At 20:23 20.11.2002, Mr. BuNgL3 said:
[snip]
Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and i
want to create an mysql condition... i trying:
$sql1=($titulotxt) ? titulo like
The usual way of doing logins with encrypted/hashed passwords is
adding new user into the table:
INSERT users SET username='$_POST[username]', password=MD5('$_POST[pwd]');
checking if username/password match:
SELECT * FROM users WHERE username='$_POST[username]' AND
password=MD5('$_POST[pwd]');
Hey...
I have a little problem... i want to read an encrypted field from mysql
database to a php variable... what is the code line that i must enter? (ex:
password validation in a login form)
Thanks...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Ben Clumeck wrote:
When using MySQL to Authenticate users for a specific directory (i.e.
www.mysite.com/user) how would it know to go to that directory (/user).
How would it know to not let someone access a file directory in that
directory (i.e. www.mysite.com/user/page2.php)?
this
When using MySQL to Authenticate users for a specific directory (i.e.
www.mysite.com/user) how would it know to go to that directory (/user).
How would it know to not let someone access a file directory in that
directory (i.e. www.mysite.com/user/page2.php)? If I am using MySQL to
query a row in
Ok, Im' pretty new at this, but I can't see what may be wrong here:
Table IMT
-
User (char)
SessionID (char)
StartTime(TIMESTAMP)
EndTime(TIMESTAMP)
Code on first page:
INSERT INTO IMT VALUES ('testuser', '$id', CURRENT_TIMESTAMP, '/0');
Code on second page:
UPDATE IMT SET
13 matches
Mail list logo