[PHP] newbie php/mysql need help

2005-03-13 Thread p80
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 --

RE: [PHP] newbie php/mysql need help

2005-03-13 Thread Robbert van Andel
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

Re: [PHP] newbie php/mysql need help

2005-03-13 Thread Burhan Khalid
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

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-22 Thread Marek Kilimajer
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) {

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Jason Wong
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) ?

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread DL Neil
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.%':;

RE: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Van Andel, Robert
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

Re: [PHP] Newbie: php/mysql (Select)

2002-11-20 Thread Ernest E Vogelsinger
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

Re: [PHP] newbie: php/mysql

2002-10-28 Thread Marek Kilimajer
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]');

[PHP] newbie: php/mysql

2002-10-27 Thread Mr. BuNgL3
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:

Re: [PHP] Newbie - PHP MySQL

2002-01-11 Thread Henning Sprang
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

[PHP] Newbie - PHP MySQL

2002-01-10 Thread Ben Clumeck
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

[PHP] Newbie PHP/MySQL Question

2001-12-06 Thread Peter van der Maas
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