ASP Free Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherASP Free Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #16  
Old January 3rd, 2006, 10:23 AM
baseballdude_'s Avatar
baseballdude_ baseballdude_ is offline
Expert Learner
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2005
Location: Wisconsin
Posts: 1,891 baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 22104 Folding Title: Starter FolderFolding Points: 22104 Folding Title: Starter Folder
Time spent in forums: 1 Week 5 Days 13 h 46 m 3 sec
Reputation Power: 70
Send a message via AIM to baseballdude_ Send a message via MSN to baseballdude_ Send a message via Yahoo to baseballdude_ Send a message via Google Talk to baseballdude_
While I understand and agree that it is nice to have it all at your immediate access, I also feel that the help you receive from a webhost (free or not) is valuable for a beginner. I feel the transition from using a host to hosting your own should be easier than jumping right into it.

As for some of your statements, I really don't agree.

FTP is just as fast as saving on your own machine.
Host interfaces are not "annoying."

Reply With Quote
  #17  
Old January 3rd, 2006, 11:33 AM
RadioactiveFrog's Avatar
RadioactiveFrog RadioactiveFrog is offline
Senior Glowing Wizard
ASP Free God 7th Plane (8000 - 8499 posts)
 
Join Date: May 2005
Location: Sussex
Posts: 8,223 RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 3 h 46 m 30 sec
Reputation Power: 326
Send a message via MSN to RadioactiveFrog
Facebook
Quote:
Originally Posted by oneMSBi
you cannot tweak the php ini on a live host now can you ? for example i recently had to write a couple of php apps that interfaced with a set of embedded systems over tcp/ip. I doubt you could find a live host with the sockets extension (on windows or its linux equivilent) enabled.

Secondly, you have much much less control over gloabl configuration parameters, and since the administration of the system is not in your direct control you cannot test your scripts out to the full extent. I often run load tests using massive client request loops form another machine. Checking for data leaks in the mysql part of my php code.

then there is the issue of access. On your own machine you have total control of all your files and can edit and maintain them with the greatest ease. No slow ftp, no irritating host interfaces or ssh.

Just edit the file and hit refresh on your browser. When you make a tweak to the php configuration, just restart apache and your good to go.

As for learning the control panel of a free/not free host.. well two thigns wrong with that as a plus point. You assume that is the only host you will use.. and in most enterprise scenarios, there is no control panel for developers.

Besides the best way to check and develop a mysql or any other database app with php is when you have direct access to the db so that you can experiment with your query's etc...

but i'm rambling.. this is my view..
i think this may never end, there are pros and cons for both. But as for editing the php ini, it is good to know how to do that, agreed, but most sites people develop will be on hosts where they can't do that !!

As for learning the control panel and staying with that host...most linux hosts use cPanel! And if not that then i believe it is plesk the second most common!!

Reply With Quote
  #18  
Old January 6th, 2006, 10:46 AM
Black&White's Avatar
Black&White Black&White is offline
Play up Pompey!
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Feb 2005
Location: Hampshire, ENG
Posts: 1,100 Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 9032 Folding Title: Novice Folder
Time spent in forums: 1 Week 1 Day 22 h 26 m 43 sec
Reputation Power: 62
Thanks for all the comments guys, like I said before I'll look at it in more detail in a week or two. I'd rep you all but the new years rep fest has probaly stopped that
__________________
Matt

Folding At Home - fold to cure!

Reply With Quote
  #19  
Old January 6th, 2006, 12:15 PM
RadioactiveFrog's Avatar
RadioactiveFrog RadioactiveFrog is offline
Senior Glowing Wizard
ASP Free God 7th Plane (8000 - 8499 posts)
 
Join Date: May 2005
Location: Sussex
Posts: 8,223 RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 3 h 46 m 30 sec
Reputation Power: 326
Send a message via MSN to RadioactiveFrog
Facebook
Quote:
Originally Posted by Black&White
Thanks for all the comments guys, like I said before I'll look at it in more detail in a week or two. I'd rep you all but the new years rep fest has probaly stopped that
Let us know if you have any more questions when you get round do looking into it more !!

Reply With Quote
  #20  
Old January 17th, 2006, 03:21 PM
Black&White's Avatar
Black&White Black&White is offline
Play up Pompey!
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Feb 2005
Location: Hampshire, ENG
Posts: 1,100 Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 9032 Folding Title: Novice Folder
Time spent in forums: 1 Week 1 Day 22 h 26 m 43 sec
Reputation Power: 62
Quote:
Originally Posted by RadioactiveFrog
Let us know if you have any more questions when you get round do looking into it more !!

Time for the questions to start as I've started to look at learning php.

I opted to go for free hosting at xr4free which isn't brilliant, had down time yesterday but it'll do if I'm only spending 30 minutes twice a week on this for now.

I have a problem with this code, well just a general programming problem. If $i is already used in the while statement, then how can I get data from another table like the stuff commented out.

What I'm trying to do in the code is loop through taking data from one database table, whilst extracting further data from another table based on the results from the first table. (the code can explain it better than I can)

Please point out if I'm using completely the wrong technique for anything/everything, this is just adapted from examples on the net. I'm a php n00b so feel free to treat me like one

php Code:
Original - php Code
  1.  
  2. <?
  3. mysql_connect(localhost,$username,$password);
  4. @mysql_select_db($database) or die( "Unable to select database");
  5. $query="SELECT * FROM fmaresult";
  6. $result=mysql_query($query);
  7.  
  8. $num=mysql_numrows($result);
  9.  
  10. if ($num > 0) {
  11. ?>
  12. <table width="500px">
  13.   <tr>
  14.     <th width="30%" align="center">Time</th>
  15.     <th width="70%" align="center">Result</th>
  16.   </tr>
  17. <?
  18. $i=0;
  19. while ($i < $num) {
  20.  
  21. $id=mysql_result($result,$i,"id");
  22. $home=mysql_result($result,$i,"home");
  23. $away=mysql_result($result,$i,"away");
  24. $hgoals=mysql_result($result,$i,"hgoals");
  25. $agoals=mysql_result($result,$i,"agoals");
  26. $generated=mysql_result($result,$i,"generated");
  27.  
  28. //$query = "SELECT * FROM fma where (id = $home)";
  29. //$result = mysql_query($query);
  30. //$hname = mysql_result($result,$i,"name");
  31.  
  32. //$query = "SELECT * FROM fma where (id = $away)";
  33. //$result = mysql_query($query);
  34. //$aname = mysql_result($result,$i,"name");
  35.  
  36. if( $odd = $i%2 )
  37. {
  38.     $class = "style2";
  39. }
  40. else
  41. {
  42.     $class = "general";
  43. }
  44.  
  45. ?>
  46.   <tr class="<? echo $class ?>">
  47.     <td width="30%" align="center"><? echo $generated ?></td>
  48.     <td width="70%" align="center"><? echo $hname . " " . $hgoals . " - " . $agoals . " " . $aname ?></td>
  49.   </tr>
  50. <?
  51. $i++;
  52. }
  53. ?>
  54. </table>
  55. <?
  56. }
  57. ?>

Reply With Quote
  #21  
Old January 17th, 2006, 04:55 PM
RadioactiveFrog's Avatar
RadioactiveFrog RadioactiveFrog is offline
Senior Glowing Wizard
ASP Free God 7th Plane (8000 - 8499 posts)
 
Join Date: May 2005
Location: Sussex
Posts: 8,223 RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160711 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 3 h 46 m 30 sec
Reputation Power: 326
Send a message via MSN to RadioactiveFrog
Facebook
ok, a different way of coding i have to say but still

the commented out bits, a quick glance would suggest that you should use something other than $query and $result as they have already been used

Other than that you don't give any errors so i don't know what i am looking for.

to be honest i wouldn't go about it this way. General code for getting info from two dbs ...

there are two ways, you can use two query's a bit like you are or you can use a join statement! I will try to explain the first as i think that is easier to understand for beginners.

php Code:
Original - php Code
  1.  
  2. //query one
  3. $get_customers = mysql_query("SELECT * FROM customer_table") or die(mysql_error());
  4. if(mysql_num_rows($get_customers) > 0)
  5. {
  6. //print table headers
  7.  
  8. while($row = mysql_fetch_object($get_customers))
  9. {
  10. //you can print any info from the first query using print $row->field_name;
  11.  
  12. //you can query another db using something like
  13. $get_cust_address = mysql_query("SELECT * FROM customer_addresses WHERE cust_id = ".$row->cust_id."") or die(mysql_error());
  14. $address_row = @mysql_fetch_object($get_cust_address);
  15.  
  16. //then you can print anything from that query using  print $address_row->house_name;
  17. }
  18. }


Hopefully all that kinda helps, if you need anything explained let me know. More than happy to help. Might be better to post it in a different thread tho so post it there and PM me!!

Loadsa ppl helped me out when i was learning PHP so i am happy to return the favour!!
Comments on this post
Black&White agrees: thank you

Reply With Quote
  #22  
Old January 18th, 2006, 12:04 PM
Black&White's Avatar
Black&White Black&White is offline
Play up Pompey!
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Feb 2005
Location: Hampshire, ENG
Posts: 1,100 Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)Black&White User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 9032 Folding Title: Novice Folder
Time spent in forums: 1 Week 1 Day 22 h 26 m 43 sec
Reputation Power: 62
Quote:
Originally Posted by RadioactiveFrog
Hopefully all that kinda helps, if you need anything explained let me know. More than happy to help. Might be better to post it in a different thread tho so post it there and PM me!!

Loadsa ppl helped me out when i was learning PHP so i am happy to return the favour!!


Thanks, I'll look at it tomorrow, do you know any sites that have examples with the correct syntax/coding standards to learn from?

Reply With Quote
  #23  
Old January 18th, 2006, 02:30 PM
RadioactiveFrog's Avatar
RadioactiveFrog RadioactiveFrog is offline
Senior Glowing Wizard
ASP Free God 7th Plane (8000 - 8499 posts)
 
Join Date: May 2005
Location: Sussex
Posts: 8,223 RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)