Re: [PHP-DB] date format question

2001-11-28 Thread Dobromir Velev
Hi, You could try to change date(m) to date(n), and date(d) to date(j). It looks that sometimes mktime() doesn't remove the trailing zeroes and returns totally different dates. The other thing you could try is $date = date(F dS, Y g:i:s A, date(U)+18000); this one takes the number seconds of

Re: [PHP-DB] ?? If Table Exists, Drop Table, then Create Table ??

2001-11-28 Thread Dobromir Velev
Hi, All MySQL version higher than 3.22 support the following syntaxis DROP TABLE IF EXISTS tbl_name HTH Dobromir Velev -Original Message- From: MrBaseball34 [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, November 27, 2001 18:37 Subject: [PHP-DB] ?? If Table

Re: [PHP-DB] Storing JPEG's in MySQL -- Is it possible?

2001-11-28 Thread Andrey Hristov
Try header('Content-type: image/gif'); Regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: PaulC [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 28, 2001 10:28 AM Subject: Re: [PHP-DB] Storing JPEG's in MySQL

Re: [PHP-DB] Storing JPEG's in MySQL -- Is it possible?

2001-11-28 Thread Andrey Hristov
excuses, image/jpeg - Original Message - From: PaulC [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 28, 2001 10:28 AM Subject: Re: [PHP-DB] Storing JPEG's in MySQL -- Is it possible? I am using this to read the uploaded file $attach_data =

[PHP-DB] JOIN - Not working.

2001-11-28 Thread Martin E. Koss
I have read the parts of the manual(s) but am just not grasping something... I have 2 tables, one holds the Property ID etc., and the other holds all the Property Details. They are connected by a field called 'PropertyID' which is a unique ID that appears in both records. I want to count the

[PHP-DB] set NULL vaules in Access DB

2001-11-28 Thread Silvia Mahiques
Hello, I have some problems to put Null value in a field of a data base in Access. This field is numeric type. When I submit the form, variable has $var='', I set it $var=Null, but ODBC returns an error: Warning: SQL error: [Microsoft][Controlador ODBC Microsoft Access] No coinciden los

Re: [PHP-DB] query to check valid emails

2001-11-28 Thread Russ Michell
select * from tbl where email like %$email%; This will find the string stored in the variable '$email' in the column 'email' Adjust having the '%' at the end, the beginning or both (as above) as they will find the string '$email' at end or at the beginning of the string stored in the column

Re: [PHP-DB] query to check valid emails

2001-11-28 Thread Jon Farmer
No this will not do what the original poster requested it will be something like the following select * from table where email regexp ^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$; Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob

Re: [PHP-DB] query to check valid emails

2001-11-28 Thread Russ Michell
Glad someone knows more than I do, or that chap would be right up a certain creek without a paddle.. Cheers Russ On Wed, 28 Nov 2001 09:44:26 - Jon Farmer [EMAIL PROTECTED] wrote: No this will not do what the original poster requested it will be something like the following select

Re: [PHP-DB] JOIN Very SLOW...

2001-11-28 Thread Jon Farmer
I would suggest changing COUNT(*) to COUNT(properties.PropertyID) Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Martin E. Koss [EMAIL PROTECTED]

Re: [PHP-DB] JOIN Very SLOW...

2001-11-28 Thread Andrey Hristov
You use LEFT JOIN so your query is optimized. Probably your tables are big, you don't have many MB of RAM. When you have big RAM, I think that tables reside in memory and join of 5 tables every 600,000 rows is done for 4-5s. May be you have to increase some of the buffers sizes of mysql.

[PHP-DB] Using variables within a SELECT statement

2001-11-28 Thread Kevin Ruiz
I'm working on an application that selects a user's userid if their password and login match. If the login and password match I want my variable $cir to run its own select statement and return its corresponding contactid...for this example we'll say that value = 5. I then want to plug in $cir

Re: [PHP-DB] Using variables within a SELECT statement

2001-11-28 Thread Richard Crawford
Try, $query=select * from my_contacts where contactid like '$cir'; Kevin Ruiz wrote: I'm working on an application that selects a user's userid if their password and login match. If the login and password match I want my variable $cir to run its own select statement and return its

RE: [PHP-DB] inserting mysql data using php array???

2001-11-28 Thread Tim Foster
Very interesting. I didn't know you could use SET with an INSERT. I tried this on MySQL and it worked. Dunno if it's standard SQL, but it didn't work on MSAccess and MS SQLServer (the only other DBs I have at hand to test it with). I wonder what other DBs it works on, because you could be

[PHP-DB] query + loop problem

2001-11-28 Thread Russ Michell
Hi there everyone: I have a generic query containing variables, substituted for values dependant upon specific circumstances: //query the DB on the basis of searches employing text input fields (LIKE) if($sql_clause == 'LIKE') { $sql = SELECT * FROM $table WHERE $field $sql_clause

Re: [PHP-DB] query + loop problem

2001-11-28 Thread Andrey Hristov
echo table\r\n; while($row = mysql_fetch_assoc($result)) { // if assoc is not available - will work but double results foreach($row as $key = $value){ echo trtd$key/tdtd$value/td/tr\r\n; } }//end loop echo /table\r\n; HTH Regards, Andrey Hristov IcyGEN Corporation

Re: [PHP-DB] inserting mysql data using php array???

2001-11-28 Thread Ubaidul Khan
Actually, there is another way of doing it. The prerequisite for this method, is that you have an auto_incremented column. If you have that, then all you have to do is insert a value into one of the columns, then grab mysql_insert_id, and update all columns, corresponding to that

Re: [PHP-DB] query + loop problem

2001-11-28 Thread Daniel Barton
Try using mysql_query to describe the table in question (describe $table), and use the output as a list of field names (and types). I wrote a generic script to do this for an app... can provide if needed (although it sure looks a little hacked right now, hmmm) -db Russ Michell wrote: Hi

[Fwd: [PHP-DB] JOIN - Not working.]

2001-11-28 Thread Daniel Barton
-- -- Dan Barton Terrestrial Program Biologist Asst. Data Manager Point Reyes Bird Observatory http://www.prbo.org [EMAIL PROTECTED] [EMAIL PROTECTED] ---BeginMessage--- Try: select sum(if(whatever=whatever,1,0)) as whatever from wherever where whatever=whatever; This is a pretty

Re: [PHP-DB] query + loop problem

2001-11-28 Thread Russ Michell
Nice one folks! Thanks for your help - it's amazing what happens to one's brain once you start to think about the problem in hand enough (enough that is, to attmept to make it make sense to others!..) - I sussed the problem, using a similar method described to me my several of you. (and a

[PHP-DB] db connect problems.

2001-11-28 Thread Ian
Hello, wonder if anyone can debug this script. I copied it from an example in a book. There is a .php file and a .inc file This is the .inc file: ?php //common_db.inc $dbhost = 'localhost'; $dbusername = 'root'; $dbuserpassword = ''; $default_dbname = 'mysql'; $MYSQL_ERRNO = ''; $MYSQL_ERROR

Re[2]: [PHP-DB] Problem with Oracle connection

2001-11-28 Thread Jonathan B. Bayer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello B., This happens with either 4.0.4 or 4.0.6. What did you do to solve it? JBB Tuesday, November 27, 2001, 2:37:17 PM, you wrote: BP le ven 23-11-2001 à 02:18, Jonathan B. Bayer a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1

[PHP-DB] resource id #2, #3, #4......

2001-11-28 Thread Kevin Ruiz
I've come across yet another problem. I have a table set up that houses four things, a person's real name, username, pass, and id. The id is used to join another table which houses that persons contacts. I've been validating the user and pass by comparing the number of rows that the sql

Re: [PHP-DB] resource id #2, #3, #4......

2001-11-28 Thread Jason Wong
On Thursday 29 November 2001 01:29, Kevin Ruiz wrote: I've come across yet another problem. [snip] $ci = select contactid from users where username='$username' and password='$password'; $cir = mysql_query($ci) or die(Couldn't execute); $query = select

[PHP-DB] Re: Using variables within a SELECT statement

2001-11-28 Thread Fred
$query=select * from my_contacts where contactid like \$cir\; Fred Kevin Ruiz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm working on an application that selects a user's userid if their password and login match. If the login and password match I want

Re: [PHP-DB] JOIN - Not working.

2001-11-28 Thread Daniel Barton
Sorry, that was a bit hasty. I was just trying to get the method across quickly. SELECT SUM(IF(Image1Desc!='insert default value of Image1Desc here'),1,0) as phTotal from PropertyDetails; would count the number of entries where Image1Desc!=default in PropertyDetails. This can be used in

RE: [PHP-DB] inserting mysql data using php array???

2001-11-28 Thread Tim Foster
Interesting. A bit tiedious, I suppose. Seems like it'd be a bit more overhead than I'd care to have, but an interesting technique nonetheless. TIM -I date this girl for two years and then the nagging starts: I wanna know your name. - Mike Binder -Original Message- From: Ubaidul

Re: [PHP-DB] db connect problems.

2001-11-28 Thread koelwebdesign
well, I didn't debug this massive script, but maybe you just want to connect to a mysql database? then this is the short way: $user = your_username_for_the_database; $pass = your_password_for_the_database; $con = mysql_connect(your_host, $user, $pass); if(!$con) { print no connection; } I

[PHP-DB] DB/pgsql.php

2001-11-28 Thread Marc
Hello I would like to create some PHP scripts which do not rely on a specific DB. As first DB I use PostgreSQL so I have included the line: include_once(DB/pgsql.php); in my script but I get the following error: Fatal error: Class db_common: Cannot inherit from undefined class pear in

Re: [PHP-DB] db connect problems.

2001-11-28 Thread koelwebdesign
which is even better, all I tried to do was to point out just how simple it can be... btw. I prefer mysql_fetch_array ps. (ik woon in koudekerk, kilometertje of 8 van waddinxveen en werk als tekenaar op een ingenieursburo... klein wereldje) Leo Kuiper Building a map in order to find what's not

[PHP-DB] GROUP BY with a string column

2001-11-28 Thread Mauro Boscarol
Can the SUM keyword in SELECT be generalized to strings? A tipical use for the SUM keyword is: SELECT column1, SUM(column2) FROM table GROUP BY column1 This works only if column2 contains numbers (and SUM is the mathematical sum). What about obtain the same behaviour, when

[PHP-DB] Re: Oracle row limit support

2001-11-28 Thread Manuel Lemos
Hello, Tomas V.V.Cox wrote: Manuel Lemos wrote: But it does not work with computed columns like those that apply functions (COUNT, SUM, SUBSTRING, etc...). The code assumes that you are actually selecting only real table fields. I think it also does not work with columns

Re: [PHP-DB] GROUP BY with a string column

2001-11-28 Thread Martín Marqués
On Mié 28 Nov 2001 19:42, you wrote: Can the SUM keyword in SELECT be generalized to strings? A tipical use for the SUM keyword is: SELECT column1, SUM(column2) FROM table GROUP BY column1 This works only if column2 contains numbers (and SUM is the mathematical sum). What

[PHP-DB] php and mysql security problem

2001-11-28 Thread Jack
Dear all I had a security problem with my homepage. I'm using the IIS 4 to host my webpage, and i got the php to run as the script of the webpage and the database i'm using for the database is mysql. Here is my question : There is a table in mysql which will let user to input some records to,