Vivid Lust Posted November 28, 2007 Share Posted November 28, 2007 Can someone please tell me how to use PHP GET with a datasbase for a use in a CMS system. Is it that the link to a page gets the information from a datasbe and then it displays on that page? Arghhhh... please help. And if you can please send in some Code snippet examples. Thanks!! Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 28, 2007 Share Posted November 28, 2007 It's kinda hard to figure out what you want...but I'm guessing something like this <?php $var = mysql_real_escape_string($_GET['var']); $query = "SELECT * FROM table WHERE col='$var'"; $result = mysql_query($query)or die(mysql_error()); while ($row = mysql_fetch_assoc($result)){ echo $row['col'].'<br>'; } ?> Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted November 28, 2007 Author Share Posted November 28, 2007 Well, on forums when its like "action=post;topic=348348... .Etc How do i make that with php?? And does it get the messages from a database? Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted November 28, 2007 Author Share Posted November 28, 2007 any help ??? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted November 28, 2007 Share Posted November 28, 2007 What exactly are you trying to accomplish? To pass information through the URL you can simply make a link that looks like this <a href="domain.com/script.php?var=something&anothervar=somethingelse">Link</a> Or you could pass it through a form action and use the same url. You can read more about GET here http://www.tizag.com/phpT/postget.php Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted November 28, 2007 Author Share Posted November 28, 2007 I want to achieve a CMS system. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.