[PHP-DB] joining 2 tables - help please..

2002-09-18 Thread rainydays_sunshine

I have 2 tables as follows:

product table
| product_id  | name | category_id
| 1| coffee| 2
| 3| orange|1
| 5| mango|1
| 2| tea |2

and
category table
|category_id | category_name |
|2| drinks|
|1| fruit   |
|4| desert|
|5| main  |

I want to get how many product in each category using sql statement, but I
keep getting NULL for the one that doesn;t have product link. I want to get
result from all category like this: drinks (2), fruit(2), desert(0),
main(0).
Help please...





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] numeric to word function

2002-09-11 Thread rainydays_sunshine

Hi..
anyone know any function to convert numeric values to word..
something like this:
1252 --> one thousand two hundred and fifty two

Thanks...




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] database result: tables with 2 coloumns

2002-09-05 Thread rainydays_sunshine

Hi..

I'm creating a database result in a table, but I need to put it into 2
columns of looping row like this:

|name1|name2|
|name3|name4|
|name5|name6|
|name7|name8|
|name9|name10  |
etc...

can anyone help me please...

iman



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] httaccess and mysql ??

2002-08-30 Thread rainydays_sunshine

I'm trying to use htaccess/htpasswd to password protect a directory.
Is there any way to connect it to mysql, so that it looks for user/password
in mysql table..

thanks heaps for your help..

Iman



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] 2 groups of random result pls help...

2002-07-31 Thread rainydays_sunshine

Hi..

I need to get 2 groups of random result with 1 group always on top of the
other.
Can anyone help me with this please..

Something like

id|group|name
21john
51smith
32  1sara
12  1michael
12don
92beth
42bob


Thanks heaps..
imn




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Re: please help.. serial number generator

2002-07-30 Thread rainydays_sunshine

I need to create some kind of 10 digits serial number where I can generate
and check that it is valid. Sort of like a checksum..
"Jj Harrison" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if u are looking for a simple random string try this php:
>
> echo md5(time());
>
> or md5() a random number your choice.
>
> md5() genetates a one way non-reversable hash. which could be kept in a
db.
>
> here is an example of the md5 hash of my library card number:
> 11d560821fb027c227d837df53a5a73a
>
> md5()  is often used to store passwords and make them non-viewable.
>
> if you are just looking for a unique number an auto-increment coloumn in
> mysql or what ever should do it.
>
>
> --
> JJ Harrison
> [EMAIL PROTECTED]
> www.tececo.com
>
> "Rainydays Sunshine" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Any ideas how to generate a unique serial number that you can check that
> > it's valid..
> >
> > Thanks...
> >
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] please help.. serial number generator

2002-07-29 Thread rainydays_sunshine

Any ideas how to generate a unique serial number that you can check that
it's valid..

Thanks...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php