[PHP-DB] Manipulating Blob Fields

2008-01-08 Thread Alan Bannister
Hi, this is my first posting to this group, so I hope it gets to the right place! I have been experimenting with uploading image files and storing them in a mySQL database table. So far I have been able to upload and extract data from an image file, add it to the database and subsequently d

Re: [PHP-DB] Beginners Problem

2008-01-08 Thread Evert Lammerts
Hi Ben, Number of things wrong with your code, look below. $select_sql = sprintf("SELECT `username` FROM `users` WHERE `username` = '$user' AND `password` = '$pass'", mysql_real_escape_string($user), mysql_real_escape_string($pass)); In the string you are printing using sprintf you need to u

RE: [PHP-DB] Re: Beginners Problem

2008-01-08 Thread Gary Wardell
Hi Peter, I'm also sort of a beginner. That's along the lines that I was thinking. Doesn't mysql_query return a result set object. So in this sample, wouldn't the IF be testing if the result object was set? I'm just trying to learn what's going on, I realized the code is wrong but didn't kno

[PHP-DB] Re: Beginners Problem

2008-01-08 Thread Peter Westergaard
Ben, I would say that the only reason $select_sql_two = mysql_query($select_sql); if($select_sql_two) { would refuse to execute is if $select_sql represents an invalid SQL statement. Whether it has records or not, you should (if I'm not very much mistaken) get a resource returned in sele

Re: [PHP-DB] Beginners Problem

2008-01-08 Thread ioannes
I use: if(ISSET($select_sql_two)&&$select_sql_two<>""&&!is_null($select_sql_two)) { or if($select_sql_two=="submit") { if "submit" is the button value. I am not sure which is best. John Ben Stones wrote: Hello, I am having another problem with PHP, and I have tried rectifying the problem

Re: [PHP-DB] Beginners Problem

2008-01-08 Thread Juan Mas
The way I normally run any sort of form page is something like this. (im fairly new as well) Since youre setting $select_sql_two without any conditions, it is setting the refresh on the page and therefore redirecting you to members.php You should then place some sort of authentication on the mem

[PHP-DB] Beginners Problem

2008-01-08 Thread Ben Stones
Hello, I am having another problem with PHP, and I have tried rectifying the problem with each try failing. The problem I have is, whenever I refresh the page or visit the URL to where the login form is (which is index.php), it automatically refreshes to the members page, even if I did not click t