[PHP-DB] check two tables at same time?

2002-06-24 Thread Noah Spitzer-Williams
hey guys, im trying to figure out a query that i can return rows from more than one table at a time. for example, i have two identical tables in structure and i want to return rows from both using one query. maybe this will help: select * from table1 and table2 where condition='value'

Re: [PHP-DB] check two tables at same time?

2002-06-24 Thread Noah Spitzer-Williams
4b1fdb20$[EMAIL PROTECTED]... SQL JOINs... http://www.mysql.com/doc/J/O/JOIN.html -Mike - Original Message - From: Noah Spitzer-Williams [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 24, 2002 4:21 PM Subject: [PHP-DB] check two tables at same time? hey guys,

[PHP-DB] query to check valid emails

2001-11-27 Thread Noah Spitzer-Williams
what's the LIKE query to see if an email address is valid? For example, in PHP it's something like if (eregi(^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$,$ email,$check)) { echo valid; } i want to sort through rows in a db and look for invalid email

[PHP-DB] order by a count of another table

2001-10-05 Thread Noah Spitzer-Williams
hey guys, i want to show a list of rows from a table sorted by the count of another table. the first table has a username field and so does the other table. so i want to sort the first table by how many rows that has the username from the other table. so something like this although i

Re: [PHP-DB] TO_DAYS() equivalent?

2001-07-11 Thread Noah Spitzer-Williams
check out the mktime() function David W. Banks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there some way to get the equivalent of select TO_DAYS(NOW()) out of PHP without querying MySQL (or whatever.) Some formatting character for the date() function

[PHP-DB] most efficient weighting system? URGENT

2001-06-30 Thread Noah Spitzer-Williams
if i have several rows in a table and i want some to have certain weights what is the best way to pick a random row based on its weight? ex of table: idweight 1 10 25 33 420 52 therefore, since there is a total weight of 40, id 1 should be picked 25% (10/40) of the time,

Re: [PHP-DB] advantages/disads of primary keys and indices?

2001-06-23 Thread Noah Spitzer-Williams
I see, What about if you had 3 or 4 columns that would always be unique, is there an advantage to naming them as primary keys? does this slow inserts because it has to check if theres a duplicate entry? Manuel Lemos [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL

Re: [PHP-DB] advantages/disads of primary keys and indices?

2001-06-23 Thread Noah Spitzer-Williams
Yeah the keys would be part of the first condition of the where clause... this table is like this: username | siteid | bannerid | clicks | someotherstat an update would be like: update tbl set clicks=clicks+1 where username='something' and siteid='something' and bannerid='something' a select

[PHP-DB] advantages/disads of primary keys and indices?

2001-06-22 Thread Noah Spitzer-Williams
what are the advantages and disadvantages of primary keys and indices? - Noah -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]