SV: [PHP-DB] i am lost (php warning)

2005-01-18 Thread Henrik Hornemann
Hi, Probably because $user is not in the database. Regards Henrik Hornemann -Oprindelig meddelelse- Fra: Earl Clare [mailto:[EMAIL PROTECTED] Sendt: 18. januar 2005 07:59 Til: php-db@lists.php.net Emne: [PHP-DB] i am lost (php warning) Prioritet: Høj Hi ya'll, I am lost as to why

RE: [PHP-DB] i am lost (php warning)

2005-01-18 Thread Earl Clare
Hey thanks guys, the email was the problem I had emial instead of email Thanks for the assistance. -Original Message- From: Peter Lovatt [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 18, 2005 1:45 AM To: Earl Clare; php-db@lists.php.net Subject: RE: [PHP-DB] i am lost (php warning) H

Re: [PHP-DB] i am lost (php warning)

2005-01-18 Thread graeme
The mysql_num_rows function requires that the argument passed to it should be a valid MySQL result from a Select statement. Your script doesn't explicitly establish a connection with the database so you could be getting an error from that call, hence $sql_query would not be a valid MySQL result

Re: [PHP-DB] i am lost (php warning)

2005-01-18 Thread Santa
it means mysql_query() filed. u must check it before using mysql_fetch_row() f.e. $query = "bla bla bla"; $result = mysql_query( $query ); if ( $result ){ while ( $row = mysql_fetch_row( $result ) ){ } } else { echo mysql_error( $db_connect ); exit; } -- PHP Database Mailing List (http://w

Re: [PHP-DB] insert into mysql-db from csv-file

2005-01-18 Thread Ruprecht Helms
Hi John, I want to read a csv-file and import the datas into a mysql-db. How do I make this. A little scriptexaple in php would be helpfull. Why not just LOAD DATA INFILE from MySQL? No need to involve PHP at all, really... I think the command you also can write in the mysql_db_query-Command. T

RE: [PHP-DB] i am lost (php warning)

2005-01-18 Thread Peter Lovatt
Hi it means that the query did not produce a result - usually this is because of a problem with the query. $sql_query = mysql_query("SELECT * FROM cm_customer WHERE emial='$user'"); I am guessing you misspelt email and this should be $sql_query = mysql_query("SELECT * FROM cm_customer WHERE e

Re: [PHP-DB] Re: last insert ID

2005-01-18 Thread Zu3Bi
You can use the mysql_insert_id() function, it returns the id generated by the last query executed on the connection... hope this helps.. Zu3Bi I was having trouble with retrieving the last insert id as well. Even after looking over the information in the link, I couldn't figure out how to mak

[PHP-DB] mysql - image storing

2005-01-18 Thread mel list_php
Hi list, I try to store/retrieve pictures into MySQL. I know that a lot of people will say this is not a good practice, so here are briefly my reasons: -I want to protect that pictures (restricted access) -I don't want to use htaccess as I want my users to be able to modify their password wheneve

RE: SV: [PHP-DB] i am lost (php warning)

2005-01-18 Thread Bastien Koert
try this: $sql = "SELECT * FROM cm_customer WHERE emial='$user'"; $sql_query = mysql_query($sql) or die($mysql_error()); bastien From: "Henrik Hornemann" <[EMAIL PROTECTED]> To: Subject: SV: [PHP-DB] i am lost (php warning) Date: Tue, 18 Jan 2005 09:15:01 +0100 Hi, Probably because $user is not i

RE: [PHP-DB] mysql - image storing

2005-01-18 Thread Bastien Koert
so what exactly is the problem? bastien From: "mel list_php" <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] mysql - image storing Date: Tue, 18 Jan 2005 11:30:12 + Hi list, I try to store/retrieve pictures into MySQL. I know that a lot of people will say this is not a good pract

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Jason Wong
On Tuesday 18 January 2005 19:30, mel list_php wrote: [snip] > $donnees=stripslashes($row[donnees_binaires]); [snip] > -I tried different combinations with addslashes/stripslashes, trim in case > of spaces, mysql_real_escape_string... I haven't looked at your code in detail but stripslashes()

RE: [PHP-DB] mysql - image storing

2005-01-18 Thread mel list_php
The problem is that I just display the "image broken link" icon. As I told before the image is displayed fine into phpMyAdmin, so I think the problem is really in the retrieval script, but I can't see where... I tried with several browser, so that's not the question either...I also tried with sev

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Joseph Crawford
Jason, can you explain why stripslashes should not be used on data taken from the db? when you store data in the db i thought it was good practice to addslashes, when you retrieve from the db, you will need to use stripslashes to remove the extra \ -- Joseph Crawford Jr. Codebowl Solutions [EMAI

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread dpgirago
> Jason, can you explain why stripslashes should not be used on data > taken from the db? when you store data in the db i thought it was good > practice to addslashes, when you retrieve from the db, you will need > to use stripslashes to remove the extra \ If I may step in... Assuming a MySQL d

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Martin Norland
Joseph Crawford wrote: Jason, can you explain why stripslashes should not be used on data taken from the db? when you store data in the db i thought it was good practice to addslashes, when you retrieve from the db, you will need to use stripslashes to remove the extra \ The slashes are added for t

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Jason Wong
On Wednesday 19 January 2005 01:51, [EMAIL PROTECTED] wrote: > > Jason, can you explain why stripslashes should not be used on data > > taken from the db? when you store data in the db i thought it was good > > practice to addslashes, when you retrieve from the db, you will need > > to use strips

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Jochem Maas
Martin Norland wrote: Joseph Crawford wrote: Jason, can you explain why stripslashes should not be used on data taken from the db? when you store data in the db i thought it was good practice to addslashes, when you retrieve from the db, you will need to use stripslashes to remove the extra \ The

RE: [PHP-DB] mysql - image storing

2005-01-18 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 18 January 2005 17:11, Joseph Crawford wrote: > Jason, can you explain why stripslashes should not be used on data > taken from the db? when you store data in the db i thought it

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Jochem Maas
Joseph Crawford wrote: Jason, can you explain why stripslashes should not be used on data taken from the db? when you store data in the db i thought it was good although 'slashing' text works pretty much all of the time (possibly the guys using exotic encodings all day will say different :-) but t

RE: [PHP-DB] PHP 5.0.3 and Oracle9i on Windows 2000/Apache

2005-01-18 Thread Chaun Keating
I agree with your theory of the possibility that the cli version of php is using a different ini file than the apache2 module/cgi. I have no clue as to how to confirm that or to correct it though, and advice there? I do restart Apache anytime I make config changes, hasn't seemed to have helped at

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Simon Rees
On Tuesday 18 January 2005 19:18, Jochem Maas wrote: > I was always under the impression that single quotes (assuming you are > delineating you args with single quotes) should (officially) be escaped > with another single quote - although backslash also works: I think it depends on the database th

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Martin Norland
Jochem Maas wrote: I was always under the impression that single quotes (assuming you are delineating you args with single quotes) should (officially) be escaped with another single quote - although backslash also works: "INSERT INTO status (hunger) values ('I''ve just eaten.');" ...alot of real

[PHP-DB] RE: i am lost (php warning)

2005-01-18 Thread Jeremy Shovan
Log In'){ $user=$_POST["email"]; $pass=$_POST["pass"]; if(!$sql_query = mysql_query("SELECT * FROM cm_customer WHERE emial='".mysql_real_escape_string($user)."'")){ //This will let you know if there is an error in your query. I do not recomend leaving this here when when it is live. d

[PHP-DB] Inserting UTF-8 data to MySQL 4.1.X

2005-01-18 Thread Martin Gallagher
Hi, I've got a problem concerning inserting UTF-8 encoded data into a MySQL 4.1.9 table. I'm working on a simple DOM based XML feed parser in PHP5; I need to insert the data parsed from the feeds into the table. The script source can be viewed: http://www.feedsfarm.com/tmp.phps Most

[PHP-DB] RE: Import into mysql from csv-file

2005-01-18 Thread Jeremy Shovan
Mysql> LOAD DATA INFILE '/tmp/jokes.txt' INTO TABLE jokes FIELDS TERMINATED BY '' http://dev.mysql.com/doc/mysql/en/mysqlimport.html http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html Jeremy Shovan -Original Message- From: Ruprecht Helms [mailto:[EMAIL PROTECTED] Sent: Monday, January 17,

[PHP-DB] Re: Subject: mysql - image storing

2005-01-18 Thread Neil Smith [MVP, Digital media]
No, really really , don't do this. Store the path to the image. You then load the path into PHP and use header("Content-type: image/jpeg"); readfile($path_from_database); exit; Then .htaccess the *actual directory* you store the images in so it's hidden from browsing. Only allow authorised people

RE: [PHP-DB] Re: Subject: mysql - image storing

2005-01-18 Thread Bastien Koert
Hi Guys, Just to throw my 2 cents in... The application requirements drive how you handle images in a db...sometimes you simply don't have the choice (though filesystem storage is better IMO). My work app / clients require that we store images (and other media or documents) in the db. So while

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Jochem Maas
Simon Rees wrote: On Tuesday 18 January 2005 19:18, Jochem Maas wrote: I was always under the impression that single quotes (assuming you are delineating you args with single quotes) should (officially) be escaped with another single quote - although backslash also works: I think it depends on the

Re: [PHP-DB] mysql - image storing

2005-01-18 Thread Jochem Maas
Martin Norland wrote: Jochem Maas wrote: I was always under the impression that single quotes (assuming you are delineating you args with single quotes) should (officially) be escaped with another single quote - although backslash also works: "INSERT INTO status (hunger) values ('I''ve just eate