[PHP-DB] Re: function ??
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: are INSERT INTO statements forbiden inside a function?? Assuming that you're referring to a PHP function and not a function of the RDBMS, no it's not forbidden. Show the relevant snip of code and any error messages being reported. Most likely, you've got a typo or syntactical problem that's causing the insert to fail (ex. forgetting to bring a global var into the function's local scope, an extra curly brace, missing quote, etc.). -- CC -- 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]
[PHP-DB] Warning: Page has Expired
How can I do away with this error when the BACK button is pushed? Thanks, olinux __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- 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]
Re: [PHP-DB] Retrieving Rows - Can I Change The Order?
Von: Caleb Walker [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 28. Juli 2001 08:26 An: Dave Watkinson; PHP-MySQL List Betreff: Re: [PHP-DB] Retrieving Rows - Can I Change The Order? Now then, I have changed a column in the table, and the only way I found to change a data type is to delete the offending column and then add it again. When I do the select now the new column, which was at $row[3] is now always $row[39]. I don't mind this, because I know where it is, but is there any way I can make it appear at $row[3] again? I'm sure you can imagine when there are quite a few pages using this code it's easier to reorder the columns in the select than to change all my if() codes! You should use mysql_fetch_array() instead of mysql_fetch_row(), so you can refer to your columns by name, as in: $q = mysql_query(select id,name from address;); $a = mysql_fetch_array ($q); == now you can use $a['id'] and $a['name'] to get the field's values. I found it always good practice to name all affected columns in a query, so you have no pain if your columns get mixed by db alters. Thomas -- 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]
Re: [PHP-DB] Re: function ?? SOLVED
SOLVED Wrong varable! Is that as bad as spelling errors? Dave | In article [EMAIL PROTECTED], [EMAIL PROTECTED] | wrote: | | are INSERT INTO statements forbiden inside a function?? | | Assuming that you're referring to a PHP function and not a function of the | RDBMS, no it's not forbidden. Show the relevant snip of code and any error | messages being reported. Most likely, you've got a typo or syntactical | problem that's causing the insert to fail (ex. forgetting to bring a global | var into the function's local scope, an extra curly brace, missing quote, | etc.). | | -- | CC | | -- | 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] | | [EMAIL PROTECTED] SeaPortNetHosting: Reliable Web Hosting Plans from $17.95 www.yourname.com http://www.SeaPortNet.com/ 1(209)551-7028 -- 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]
[PHP-DB] Re: Problems with update und delete's
the id is my primary key - is the primary automatic indexed? Uli Jeffery Cann wrote: It sounds like your 'id' column does not have an index. Jeff Uli wrote: Hallo! Maybe you can help me with my problems. I have a html form that deletes (or updates) over a php-script datas from my database like delete from table_name where id=xy and it works correctly. But when I have about 100 entries in my database then it takes about 50 sec. to delete an entry. Do you know what it can be Please send replies to this newsgroup or to [EMAIL PROTECTED] Thanx a lot. Uli -- 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]
[PHP-DB] InterBase
Warning: InterBase: arithmetic exception, numeric overflow, or string truncation Cannot transliterate character between character sets in /home/larionov/public_html/base.php on line 6 How I can turn off tranliteration? ···· Sergey Larionov-[EMAIL PROTECTED], http://larionov.akl.ru -- 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]
[PHP-DB] Seperate a variable
Hi, I m extracting a variable from a dbase and assigning it as say $var .The Value of this variable is always a/or more number/s at the begining followed by a set of characters .I want to seperate the numbers from the characters.Can anybody explain me how to say value of $var= 511Tha -- Donot rely on the Operating System which don't have any sources for. -Seen somewhere on the Net ___ _ _ _ |_|_||_||_||\/||_|| \ _|| || || \| || ||_/ -- 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]
[PHP-DB] Warning Page Expired
How do I eliminate this error when the BACK button is used? Warning Page Expired Thanks, olinux __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- 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]
Re: [PHP-DB] Record Update Link
There's a good tutorial that covers the subject of creating a list of contacts with hyperlinks to edit, delete etc. at: http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html It was my first intro to PHP and was extremely helpful, although if I remember right a couple of the lines in his code were truncated by my browser. Still was able to use and fill in the blanks ok. Steve Fitzgerald wrote: I seem to be having difficulty creating a hypertext link between the results of a sql query, ie a a formated page with a contact record (FirstName, LastName, etc.) to a page that will allow for editing. The results page is text only and the edit/update page has text boxes. Not sure if this clear, but any help would be greatly appreciated. -- 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]
[PHP-DB] Re: Record Update Link
(posted emailed) I seem to be having difficulty creating a hypertext link between the results of a sql query, ie a a formated page with a contact record (FirstName, LastName, etc.) to a page that will allow for editing. I think that I'm doing what you're trying to do. See my demo at: http://pmaco.fdns.net/demo/contacts1.php It's a demo page, so go ahead and edit records all you like. While viewing any record, select the Edit button, and you'll be taken to a page where the that record may be edited. The results page is text only and the edit/update page has text boxes. Well, I think this is what I'm doing, if I understand you right. Not sure if this clear, but any help would be greatly appreciated. If the demo is similar to the result you'd like, let me know and I'll show how it's done. Regards, Al S. -- * Hillman other Rootes Group manuals online: http://asavage.fdns.net/Hillman * Ford Falcon manuals online: http://FalconFAQ.fdns.net OREGON - The Great Pacific NorthWET cc: Steve Fitzgerald [EMAIL PROTECTED] -- 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]
[PHP-DB] 2 Tables- 1 Insert Problem
I'm trying to insert data into two separate tables using 1 INSERT. The code below represents a first crack at it, but I can't seem to figure out how to get this to work properly. Thanks. Steve ? $db_name=testDB; $table_name1 = my_contacts; $table_name2= company; $connection = @mysql_connect (,,or die (Couldn't connect.); $db = @mysql_select_db($db_name, $connection) or die (Couldn't select database.); $sql_1 = INSERT INTO $table_name1 (id,fname,lname,address1,address2,address3,postcode,country,prim_tel,sec_tel ,email,birthday) VALUES (\\, \$fname\,\$lname\,\$address1\,\$address2\,\$address3\,\$postcode\ , \$country\,\$prim_tel\,\$sec_tel\,\$email\,\$birthday\) ; $sql_2 = INSERT INTO $table_name2 WHERE my_contacts.company=$companyid (companyname,website) VALUES (\\, \$companyname\,\$website\) ; $result = @mysql_query ($sql_1,$sql_2,$connection) or die (Couldn't execute query.); ? -- 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]
RE: [PHP-DB] 'htaccess method : how to modify passwords from PHP scripts ?
That is where I got the class originally... The url for the guys who wrote the class is here: http://www.thewebmasters.net/ They have a link right on the front page. There are actually two classes.. htgroup and htpasswd... I have put them into one file for my own use. Sorry to everyone for the confusion. JD -Original Message- From: Caleb Walker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 25, 2001 6:56 PM To: JD Daniels; Samuel Torton Cc: php Subject: Re: [PHP-DB] 'htaccess method : how to modify passwords from PHP scripts ? On Tuesday 24 July 2001 10:22 am, JD Daniels wrote: There is a fantastic class that takes care of writing .ht* files... look here: http://phpclasses.upperdesign.com/ Couldnt find anything on writing .ht* files. Are you sure? -- 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]
RE: [PHP-DB] 2 Tables- 1 Insert Problem
Not possible. do this $result_1 = mysql_query($sql1) or die('Insert 1 failed'); do this $result_2 = mysql_query($sql2) or die('Insert 2 failed'); olinux -Original Message- From: Steve Fitzgerald [mailto:[EMAIL PROTECTED]] I'm trying to insert data into two separate tables using 1 INSERT. The code below represents a first crack at it, but I can't seem to figure out how to get this to work properly. Thanks. Steve _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- 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]
[PHP-DB] Checking radio buttons for multiple records/Updating multiple records...
Ok, here is what I am trying to do. I know that it is very common. Simplified: I have a tabble of users with an AUTHORIZE field [type ENUM - Yes or No]. They sign up and once I authorize them. I pull up all of the records and display them something like this: User Name - Authorize: [] Yes [] No So i run my select thru a while loop and end up with User Name - Authorize: [] Yes [] No User2 Name - Authorize: [] Yes [] No User3 Name - Authorize: [] Yes [] No User4 Name - Authorize: [] Yes [] No The settings already in the database should show. So that either Yes or No is checked for each user. so here is the code I use: if ($authorize == Y) { $chk_authorize = Authorized: input type=\radio\ name=\authorize\ value=\Y\ checkedYes input type=\radio\ name=\authorize\ value=\N\No; } else { $chk_authorize = Authorized: input type=\radio\ name=\authorize\ value=\Y\Yes input type=\radio\ name=\authorize\ value=\N\ checkedNo; } This works EXCEPT only the last field displays a checked radio button [because the names are all the same. How can do this so that each record displays current authorization setting? After this I need to be able to SUBMIT the info to UPDATE the table. I understand that I will have to execute a number of update statements ... But how can I create these statements that tie the correct username and AUTHORIZE value together? thanks much, olinux _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- 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]