[PHP-DB] Re: General Question!
¨First of all you must NOT use the inputs right from the field and put it in your sql. use trim first for secuety ... ok if you have a several fields with the same name (although wrong way to do it! ) , you can use the print_r($_POST); function to see what you get out of it or else the last input wil be posted (I think) Hope this helped. :) Jerry [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If I have a form that has in a text field something like this below how would my query look to update all in the form to the fb? input type=text name=username input type=text name=total So there is data inputed in username field and total. Now let's say there is 5 of these text fields for the one form. All named the same (e.g. username and total) but in each area the user puts something different. so if I have UPDATE tbl score='$total' WHERE username='$username'; (quick work only so you know what I mean) But that will ONLY update one part of the form rather than all text areas to the db. How can I get each one to input? Keeping in mind each line of text area has the same form name as the previous. Is there a way around this so everything is updated correctly instead of bits here and there? Cheers! Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: General Question!
input type=text name=username input type=text name=total You have to chainge this into: input type=text name=username[] input type=text name=total[] UPDATE tbl score='$total' WHERE username='$username'; Then you have to chainge the query to something like this: for ($a = 0; $a = count($username) -1; $a++){ $query = UPDATE tbl score='$total[$a]' WHERE username='$username[$a]; mysql_query($query) or die (Error message of your own, or something like that); } I hope this works Maurice -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How to get only 2nd row in result set ???
DOH! - A private message arrived read below When you mention it, ofcourse this is the correct (and sane sollution). I guess I was giving more flesh to the bone that the previous poster posted. Looping through when limit is there is plain and simple stupid... Shame on me! :) Kim Steinhaug - Original Message - From: Ross Honniball ross at bookshop dot jcu dot edu dot au To: Kim Steinhaug [EMAIL PROTECTED] Sent: Monday, April 05, 2004 4:18 AM Subject: Re: [PHP-DB] How to get only 2nd row in result set ??? If you specify LIMIT 2,1 then this will only return 1 record (ie. the second parameter is the number of results to return) At 06:17 AM 5/04/2004, you wrote: I would say the same, do the query and then a loop through the results. Skip the first one and output the second, eg. $levels = mysql_query(SELECT levelID from hf_levels ORDER BY levelorder RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error()); for($i=0;$imysql_num_rows($levels);$i++){ $item = mysql_fetch_object($levels); if($i){ // Do the output with the new object, $item break; } } -- -- Kim Steinhaug -- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. -- www.steinhaug.com - www.easywebshop.no - www.webkitpro.com -- Mikhail U. Petrov [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! But what's the problem? You can use mysql_fetch_array() 2 times. But may be I understood question not correctly... Friday, April 2, 2004, 10:06:05 PM, -{ wrote: RB I couldn't find anything like this from my archive searches ... so here goes: RB I've got this query: RB $levels = mysql_query(SELECT levelID from hf_levels ORDER BY levelorder RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error()); RB but I can't figure out how to write the rest of the code ... I need to skip RB the first row and get the data from the 2nd row... but because there's an RB optional up to 255 possible rows in this table, and the order of these are RB determined by a user customizable field called levelorder ... so I can't RB just pick the specific numrows - 1 ... :-/ RB I know this is a kludge to do it this way ... but it's what I need for now RB ... later I'll get to do it a more brilliant way... RB TIA RB Rene RB -- RB Rene Brehmer RB aka Metalbunny RB ~ If you don't like what I have to say ... don't read it ~ RB http://metalbunny.net/ RB References, tools, and other useful stuff... RB Check out the new Metalbunny forums @ http://forums.metalbunny.net/ -- Best regards, Mikhail U. Petrov mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php . Ross Honniball JCU Bookshop Cairns Supervisor . James Cook Uni, McGreggor Rd, Smithfield, Qld. 4878, Australia . Ph:07.4042.1157 Fx:07.4042.1158 Em:[EMAIL PROTECTED] . There are no problems. Only solutions. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Tree structure - how to show only current branch ??
ok this may help a bit (I think) you want something like this: A --A1 --A2 --A3 B C --C1 --C2 --C3 C3A C3B C3C D E F G First you got to have your tables like this. ID, title, PID (parrent id) ok use function rec_tree($pid) { //some connect stuff here $sql = SELECT * FROM mymenu WHERE PID = '$pid' // some database get here // and print the output // then use the id and call your self rec_tree($id) } first you start with the $pid = 0 and you get A B C D E F G and then for each time you write out a line (data) you call the same function that you made with pid = the lines id make sure you use some DEAD LOCK detection like IF or a counter or something so you don't get an infi. loop:) -{ Rene Brehmer }- [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] At 20:03 30-03-2004, you wrote: Well, I did a similar system for my CMS sollution. If I understand you correct you want to sort the main branch, keeping the subs. Not really ... I want to be able to expand the current sub to the current sub's level, list the subfolders contained within the current sub, and have it not expand any other subs of the root... and then still list the entire root folder structure before and after ... my main problem is really finding an easy way to locate the root folder to start branching, with using as few queries as possible ... The sorting is really completely irrelevant in this connection, it's more a matter of locating the right branches to expand... I've not looked at it since I did the first test ... been busy with other things ... but was considering doing a series of reverse recursive SQL pulls, where I start with the requested folder's ID, put that in an array, then find the parent of that folder, put that into the same array, find the parent of that folder, put that ID into the array, and keep doing that till I reach the root folder. Then load the root folders and print them out till I reach the root folder in the array, and then start branching out from there, listing the contents of the subfolders, and branching out the ones in the array... The reason I don't like to keep the level of the folder in the database is that I want to be able to move any and all folders around across levels in the database ... and keep their subfolders attached ... Sofar I'm a bit blank in regards to this especially because I'm doing it to figure out how to do it, but don't really have anything specific I want to use it for yet, that requires more than 2 level of folders... Rene -- Rene Brehmer aka Metalbunny ~ If you don't like what I have to say ... don't read it ~ http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums @ http://forums.metalbunny.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] BindTextDomain - Reg
While using the BindTextDomain() in my PHP Programs which is including the HORDE Libraries and Chora to connect with CVS. I am getting Function Undefined Problem. Operating System : Windows2000Professional PHP : 4.3.4 Even the needed dll's such as iconv and libintl-1.dll are available in my System Directory as well as PHP directory. Apache Version : 1.3 Thanks and Regards, Santhosh Kumar.M
[PHP-DB] RE: Drop down menu with PHP
Hi Charles, If you mean columns when you say rows the answer is no. When you mean rows when your saying rows the answer is yes. That's what you are doing with your code below. Rolf /// / Suicidal twin kills sister by mistake!/ /// -Oorspronkelijk bericht- Van: The Image Builder [mailto:[EMAIL PROTECTED] Verzonden: maandag 5 april 2004 4:01 Aan: [EMAIL PROTECTED] Onderwerp: Drop down menu with PHP Hello, I have code for a drop down menu that works fine. But, though I only want the results from one row to fill the form, I want it to show 2 rows in the drop down menu. Can I do that? I would appreciate your help. Here is what I have now: ? mysql_connect(localhost,user,password); mysql_select_db(database); $sql = select distinct category from books ORDER BY category ASC; $makes_result = mysql_query($sql); print (select name=\category\\n); print(option selected value=\\Please select a Category/option\n); while($row = mysql_fetch_row($makes_result)) { print(option value=\$row[0]\$row[0]/option\n); } print(/select); ? Thanks in advance Charles -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] password input type
Does using a pasword input type input name=password type=password make the transfer more secure from someone sniffing my connection or does it only shield an onlooker from seeing what the user enters? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] password input type
It's presentation layer only - the data is not encrypted during transfer. Rich -Original Message- From: matthew perry [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 2:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] password input type Does using a pasword input type input name=password type=password make the transfer more secure from someone sniffing my connection or does it only shield an onlooker from seeing what the user enters? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] password input type
I'm pretty sure it just shields the on looker from viewing. View source in the browser still shows what the VALUE is, if any. Does using a pasword input type input name=password type=password make the transfer more secure from someone sniffing my connection or does it only shield an onlooker from seeing what the user enters? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] password input type
It is possible to md5 encrypt a password before you send it off to the server using javascript onSubmit function. Check this code out: http://pajhome.org.uk/crypt/md5/ -Jeff Moss - Original Message - From: matthew perry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 05, 2004 12:14 PM Subject: [PHP-DB] password input type Does using a pasword input type input name=password type=password make the transfer more secure from someone sniffing my connection or does it only shield an onlooker from seeing what the user enters? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PDFLib
Has anyone had any experience extracting text from a fulltext field/column in a MySQL DB and, using the PDFLib library, converting it to a PDF on-the-fly? I can create the PDF, but it is taking all of the text (about 6300 characters) and putting it on just one line - which goes off of the viewable page (as you can imagine). If anyone has any ideas or experience with this, that'd be super. -- Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 587-3133 (413) 210-7984 Mobile (512) 681-7043 Fax -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PDFLib
I LOVE FPDF. I don't know where I found it, but I can insert images, it wraps text -- it's pretty fantastic. Get it. Beckman On Mon, 5 Apr 2004, Nathan Mealey wrote: Has anyone had any experience extracting text from a fulltext field/column in a MySQL DB and, using the PDFLib library, converting it to a PDF on-the-fly? I can create the PDF, but it is taking all of the text (about 6300 characters) and putting it on just one line - which goes off of the viewable page (as you can imagine). If anyone has any ideas or experience with this, that'd be super. -- Nathan Mealey Director of Operations Cycle-Smart, Inc. P.O. Box 1482 Northampton, MA 01061-1482 [EMAIL PROTECTED] (413) 587-3133 (413) 210-7984 Mobile (512) 681-7043 Fax -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php