Re: [PHP-DB] MySQL and apostrophes, interesting problem. 42082

2002-03-10 Thread Robert Weeks
See the manual at php.net: addslashes() stripslashes() I've found it easier to just turn on magic-quotes in the php.ini file This is all covered at php.net Robert - Original Message - From: "Nick Patsaros" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PR

Re: [PHP-DB] mysql and file upload problems

2002-03-09 Thread Robert Weeks
Why don't you just do the sql insert *after* the file upload function?: Pseudocode: if( NOT file upload attack, wrong file type, etc.){ //copy the file to the permanaent location //call function to insert file details into the database } else{ //echo error to user

Re: [PHP-DB] Viewing Session Varibles

2002-02-07 Thread Robert Weeks
Ok, This is driving me nuts. I'm sure its something simple but I can't seem to find the glitch. I'm trying to make a simple shopping cart using Session varibles to store the item => quantity pairs, then I loop thru the cart and query the db to get the item details, etc.. Most of it works fine bu

[PHP-DB] Viewing Session Varibles

2002-02-07 Thread Robert Weeks
t get the $qty to set. Thanks, Robert Weeks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] File Uploading... Two problems...

2002-02-05 Thread Robert Weeks
while (strlen($nps)<$len) > { > > $c = chr(mt_rand (0,255)); > > if (eregi("^[a-z0-9]$", $c)) $nps = $nps.$c; > > } > > $nps.=".$ext"; > return ($nps); > > } > > Of course, depending on what you are doi

Re: [PHP-DB] Username

2002-02-05 Thread Robert Weeks
If you read to part 2 of the tutorial it has quite a bit on inserting data. The reason there are tutorials and books are to teach the *concepts* behind what they are showing you. This is probably what is tripping you up; you create the table with uid as an integer, auto increment, not null field

Re: [PHP-DB] File Uploading... Two problems...

2002-02-05 Thread Robert Weeks
On 2/5/02 9:58 AM, "Todd Williamsen" <[EMAIL PROTECTED]> wrote: > Now I have two small issues... > > 1. How would I automate the file naming otherwise errors will fly (can't > copy file... blah blah) You could replace the file name with a randomly generated number. There are a number of ways to

Re: [PHP-DB] Username

2002-02-05 Thread Robert Weeks
What exactly is the error message? Did you change config.php to use the name of your database and your username & password? I've found the articles at devshed to be helpful in the past. This particular one has a pretty good explaination of setting up a user authentication system: http://www.devs

Re: [PHP-DB] Hashes

2001-12-21 Thread Robert Weeks
m' => w_c ); while (list($val, $key) = each($item_array)){ if ($key == $item){ $item_text = $val; } } echo $item_text; Thanks again, Robert - Original Message - From: "Matthew Loff" <[EMAIL PROTECTED]> To: "'Robert Weeks'" <[EMAIL

[PHP-DB] Hashes

2001-12-21 Thread Robert Weeks
I'm trying to use a hash to translate a value into something human readable. I know how to do this with an if-else but that seems like a waste of typing. I have a bunch of items in the db and their values are abbreciations such as 'm_r'. I want m_r to show on the page as "Mens Rings". I was try

Re: [PHP-DB] question

2001-12-12 Thread Robert Weeks
Yup, I knew it was something really simple. I should never touch a computer before the coffee is brewed ;-) Thanks! Robert On Wednesday, December 12, 2001, at 11:09 AM, Steve Cayford wrote: > > Do you want $$fname = $val here? Taking the string in $fname as the > name of a variable to which

[PHP-DB] question

2001-12-12 Thread Robert Weeks
Hi, I'm a little stumped here, maybe I haven't had enough coffee yet... Anyway, I have a lot of SQL queries that return one row if there is a match and instead of having to write out something like this: $firstname = $row["firstname"]; $lastname = $row["lastname"]; $midinitial = $row["midin