Re: [PHP] databases, loops and tables oh my...
Jason Gerfen wrote: Not sure about this one, I am trying to execute a SQL query to retrieve records then loop over the records and display X amount per line. Any X ammount of what per 'line'? db records (or elelphants)? and by line do you mean 'html table row'? assuming I got that correct, check my comments below (hopefully it's understandable): help is appreciated. $sql = @mysql_query( "SELECT * FROM subnets", $db ); $num = @mysql_num_rows( $sql ); $subnets .= "class=\"fntTR\" colspan=\"$num\">Subnets and global parameters for each"; $i = 1; // add the following line here: $numPerRow = 3; // number of records to show per table row. while( $list = @mysql_fetch_array( $sql ) ) { list( $id, $subnet, $mask, $dns01, $dns02, $router, $vlan, $scope, $range1, $range2, $vlan ) = $list; // and replace this if(): if( $i % 2 == 0 ) { $tr = ""; } // with this: $tr = ($i % $numPerRow) ? "" : ""; if( $scope == "no" ) { $range1 = "NULL"; $range2 = "NULL"; } $subnets .= " align=\"center\">$vlan Subnet:$subnet Mask:$mask DNS:$dns01 DNS:$dns02 Gateway:$router Vlan:$vlan Scope:$range1 - $range2 " . $tr; $i++; } $subnets .= ""; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] databases, loops and tables oh my...
Not sure about this one, I am trying to execute a SQL query to retrieve records then loop over the records and display X amount per line. Any help is appreciated. $sql = @mysql_query( "SELECT * FROM subnets", $db ); $num = @mysql_num_rows( $sql ); $subnets .= "class=\"fntTR\" colspan=\"$num\">Subnets and global parameters for each"; $i = 1; while( $list = @mysql_fetch_array( $sql ) ) { list( $id, $subnet, $mask, $dns01, $dns02, $router, $vlan, $scope, $range1, $range2, $vlan ) = $list; if( $i % 2 == 0 ) { $tr = ""; } if( $scope == "no" ) { $range1 = "NULL"; $range2 = "NULL"; } $subnets .= " align=\"center\">$vlan Subnet:$subnet Mask:$mask DNS:$dns01 DNS:$dns02 Gateway:$router Vlan:$vlan Scope:$range1 - $range2 " . $tr; $i++; } $subnets .= ""; -- Jason Gerfen "When asked what love is: Love is the Jager talking." ~Craig Baldo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Databases
You find a reasonable example if you go googling for 'PHP tutorial' and then sit down for an evening and read the manual. C -Original Message- From: Shaun van den Berg [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 07:14 To: [EMAIL PROTECTED] Subject: [PHP] Databases Hi Im kinda new to php. I have a linux server witch has our website on it. I want to make a download page. If a person clicks on a link , they must be able to download from our server. How difficult is this , can you send me an example ? Thanks Shaun van den Berg -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Databases
On Thursday 25 Sep 2003 08:14, Shaun van den Berg wrote: > Hi > > Im kinda new to php. I have a linux server witch has our website on it. I > want to make a download page. If a person clicks on a link , they must be > able to download from our server. How difficult is this , can you send me > an example ? How long is a piece of string? Too vague a question. Authenticated downloads? Downloads of files not in the web tree? Both have been covered in the past 2 weeks or so, and can be found in the archives. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Databases
Hi Im kinda new to php. I have a linux server witch has our website on it. I want to make a download page. If a person clicks on a link , they must be able to download from our server. How difficult is this , can you send me an example ? Thanks Shaun van den Berg -- Novtel Consulting Tel: +27 21 9822373 Fax: +27 21 9815846 Please visit our website: www.novtel.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Databases vs. File Access
Totally depends on the data in question. I tend to organise my data in a mySQL database, for easy queries, sorting, categorisation, etc etc. However sometimes I associate a file to a record (eg a photo of a member or employee)... so the employee with the id 45 will have a photo stored in the filesystem called 45.jpg. I tend to keep raw-text-based data in a database, and binary or heavily formatted data (mp3s, giffs, JPEGs, PNGs, .doc's, .xls's) in the file system, attached to the database records. I've read that you get faster queries by separating bulky data from the simple stuff... this separation can be done with files, or with relational db tables... I guess it depends a lot on what sort of data, how you will use it, and which your prefer (file/db). One other bit of advice i've read: if you do have LOTS of files in a filesystem (1000's, not 100's), it's best to break them up somehow... by alphabet (a/, b/, c/, etc), year (2002/, 2003/, 2004/, etc), category (entrés/, mains/, soups/, deserts/, etc), etc. on 09/01/03 4:04 PM, Erich Kolb ([EMAIL PROTECTED]) wrote: > I am going to be dealing with a ton of data shortly and my goal is to make > it accessible via the web. I am curious about the performance differences > between using a database or leaving the data in the individual files they > originated in. Can anyone offer any recommendations? Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Databases vs. File Access
I am going to be dealing with a ton of data shortly and my goal is to make it accessible via the web. I am curious about the performance differences between using a database or leaving the data in the individual files they originated in. Can anyone offer any recommendations? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Databases?
http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html -Stewart -Original Message- From: Kyle Smith [mailto:[EMAIL PROTECTED]] Sent: 26 October 2001 00:49 To: [EMAIL PROTECTED] Subject: [PHP] Databases? Can someone please give me the simplest tutorial to databases they can find? -- PHP General 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] Databases?
Can someone please give me the simplest tutorial to databases they can find?
Re: [PHP] Databases, arrays and woes
I think it's very simple to do it. '; // new Type list echo '' . $row['Type']; } // print out the rest of the row like : // Place Name and Place Abbr and ther link echo ''.$row['place name']; echo ' jump '.$row['place abbr'].''; //... } //... ?> or maybe I missed something? - Original Message - From: Kath <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 30, 2001 3:17 PM Subject: [PHP] Databases, arrays and woes > I have a MySQL table which stores information like this: > > | Type | Place Name | Place Abbrv | > > and lets say I have data in the table like: > > Example #1: > | Office | Bill's Office | bo | > | Store | Millcreek Supply | mcs | > | Office | Harry's Office | ho | > | Store | Sam's Discount Taxidermy | sdt | > | Shipping | East Coast Distribution Facility | ecdf | > > What I'd like to do is be able to have PHP grab the information out of the > database and sort like this on a webpage: > > Type Name #1: > - Place Name (with hyperlink using the abbrv) > - Place Name (with hyperlink using the abbrv) > > Type Name #2: > - Place Name (with hyperlink using the abbrv) > - Place Name (with hyperlink using the abbrv) > > For a better illustration, using the information from Example #1: > > Example #2: > > Office > - Bill's Office (link using bo) > - Harry's Office (link using ho) > > Store > - Millcreek Supply (link using mcs) > - Sam's Discount Taxidermy (link using sdt) > > Shipping > - East Coast Distribution Facility (link using ecdf) > > So basically it has to group the common "Type" fields together and list them > together and make a hyperlink. > > What is the best way to do this? I've tried arrays, different MySQL calls, > voodoo, ouija boards and drinking, but nothing has gotten me what I need. > > btw, the information in "Type" is not a set number. There could be 2 or 200 > different "Type". (Otherwise this would be much easier and I might not have > a hangover from aforementioned drinking ;p ) > > - k > > > -- > PHP General 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 General 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] Databases, arrays and woes
I have a MySQL table which stores information like this: | Type | Place Name | Place Abbrv | and lets say I have data in the table like: Example #1: | Office | Bill's Office | bo | | Store | Millcreek Supply | mcs | | Office | Harry's Office | ho | | Store | Sam's Discount Taxidermy | sdt | | Shipping | East Coast Distribution Facility | ecdf | What I'd like to do is be able to have PHP grab the information out of the database and sort like this on a webpage: Type Name #1: - Place Name (with hyperlink using the abbrv) - Place Name (with hyperlink using the abbrv) Type Name #2: - Place Name (with hyperlink using the abbrv) - Place Name (with hyperlink using the abbrv) For a better illustration, using the information from Example #1: Example #2: Office - Bill's Office (link using bo) - Harry's Office (link using ho) Store - Millcreek Supply (link using mcs) - Sam's Discount Taxidermy (link using sdt) Shipping - East Coast Distribution Facility (link using ecdf) So basically it has to group the common "Type" fields together and list them together and make a hyperlink. What is the best way to do this? I've tried arrays, different MySQL calls, voodoo, ouija boards and drinking, but nothing has gotten me what I need. btw, the information in "Type" is not a set number. There could be 2 or 200 different "Type". (Otherwise this would be much easier and I might not have a hangover from aforementioned drinking ;p ) - k -- PHP General 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] Databases and HTML forms
check out phpMyAdmin i use it everywhere Serge -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: Monday, May 07, 2001 4:22 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Databases and HTML forms Hello Michael, On 20-Apr-01 14:38:48, you wrote: >I'm needing to have a form that pulls a bunch of database fields into it and >then allows you to modify the fields and does the subsequent update in the >database. This seems like something that has to be done all the time. Is >there a right way to go about doing this? Some kind of class library or >anything? Or do I just kind of code it up? Thanks for any responses. Right, you may want to check this PHP class that does exactly what you need: http://phpclasses.UpperDesign.com/browse.html/package/231 Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp -- -- PHP General 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 General 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] Databases and HTML forms
Hello Michael, On 20-Apr-01 14:38:48, you wrote: >I'm needing to have a form that pulls a bunch of database fields into it and >then allows you to modify the fields and does the subsequent update in the >database. This seems like something that has to be done all the time. Is >there a right way to go about doing this? Some kind of class library or >anything? Or do I just kind of code it up? Thanks for any responses. Right, you may want to check this PHP class that does exactly what you need: http://phpclasses.UpperDesign.com/browse.html/package/231 Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp -- -- PHP General 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] Databases and HTML forms
Just Kinda code it up -- PHP General 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] Databases and HTML forms
I'm needing to have a form that pulls a bunch of database fields into it and then allows you to modify the fields and does the subsequent update in the database. This seems like something that has to be done all the time. Is there a right way to go about doing this? Some kind of class library or anything? Or do I just kind of code it up? Thanks for any responses. Mike ** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ** -- PHP General 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]