SelfObscurity Posted May 26, 2007 Share Posted May 26, 2007 Evening everyone, I have been working on a databse driven web site for some time now. I have been working with web development for a long time, but I always took the easy way out. Well, I have no problem with the easy stuff (connecting to the DB, displaying table information, etc). A friend of mine says that it would be quite easy for me to put everything, and make it all run off the index.php. So my question would be, how would I go about that. I have looked around and I see that I would use if statements. What I want to do is have, for example... index.php?area=1, I would want to have something say if area was the var, then it would pull from that database, whatever number was showing. How would I even do that? or index.php?area=news... how could I get that to reflect at a particular table and.. index.php?area=news&id=1 ... I have seen that around, but I cant find anything to help me that I understand.. Any help would be appreciated, or a direction of a site tot ake a look at that will help, thank you! Link to comment https://forums.phpfreaks.com/topic/53011-solved-php-mysql-and-a-headache/ Share on other sites More sharing options...
Caesar Posted May 26, 2007 Share Posted May 26, 2007 My man, we're talking about the very basics of PHP here. I am most certain that if you're hitting a roadblock with this, you will only confuse yourself more if you try to take on more than you know. Best advise I can give you, is to take the time to learn PHP form the very basics...ground up. Life will be easier, and your experience with PHP will be much more beautiful. <?php $page = $_GET['content']; if(isset($_GET['content'])) { $query = $db->query("SELECT * FROM table WHERE content='$page'"); $result = $db->fetch_array($query); } ?> Link to comment https://forums.phpfreaks.com/topic/53011-solved-php-mysql-and-a-headache/#findComment-261881 Share on other sites More sharing options...
SelfObscurity Posted May 26, 2007 Author Share Posted May 26, 2007 Thank you. I have never hard real time to get into the books I have on PHP, so anytime I needed something, i would look for just that functionality, and learn about just that. Thank's for the direction. Link to comment https://forums.phpfreaks.com/topic/53011-solved-php-mysql-and-a-headache/#findComment-261883 Share on other sites More sharing options...
Caesar Posted May 26, 2007 Share Posted May 26, 2007 No problem. And yeah...start with finding out how $_GET works...(http://www.w3schools.com/php/php_get.asp). That should get you on the right track. Dedicate a couple days to writing/duplicating really simple PHP scripts...and find out how they work....be worth it in the long run. Link to comment https://forums.phpfreaks.com/topic/53011-solved-php-mysql-and-a-headache/#findComment-261885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.