aznjay Posted September 12, 2008 Share Posted September 12, 2008 Creating a tutorial box: if(isset($_GET['page'])) { $query = "SELECT * FROM phptut"; $result = mysql_query($query) or die('Error, query failed'); while($row = mysql_fetch_array($result)){ echo ' <div id="tutorial"><a href="index.php?page='.$row['id'].'">'.$row['title'].'</a> </div>'; echo '<br>'; } }else{ $pagt = $_GET['page']; $query = "SELECT * FROM phptut WHERE id= '$page'"; $result = mysql_query($query) or die('Error, query failed'); while($row = mysql_fetch_array($result)){ echo $row['article']; echo '<br>'; } } I tried using that, but the data from table PHPTUT does not show up........basically what i'm trying to do is when the table rows shows as links and when they click on the link it'll give specific data in that row. Can anyone help me recode? fix this? Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 Do you get any errors? Did you connect to database (there's no sign of this in your code)? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 12, 2008 Share Posted September 12, 2008 $pagt = $_GET['page']; Quote Link to comment Share on other sites More sharing options...
aznjay Posted September 12, 2008 Author Share Posted September 12, 2008 yes no error but the data doesn't show up...from database Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 12, 2008 Share Posted September 12, 2008 $pagt = $_GET['page']; ^ that's at least one of the problems. Quote Link to comment Share on other sites More sharing options...
aznjay Posted September 12, 2008 Author Share Posted September 12, 2008 take a look at it it's blank http://alltraxx.uni.cc/phptuts.php....basically what i'm trying to do is creating the data as links for example: I will show the TITLE as the link and when a person click on the title i want the ARTICLE to show up in that specific title. Can anyone create me a script that can do that? I'm going nuts... Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 Did you fix the typo BlueSkyIS is showing you? Quote Link to comment Share on other sites More sharing options...
aznjay Posted September 12, 2008 Author Share Posted September 12, 2008 I did and it still does not work.. Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 Do you have error reporting enabled? Quote Link to comment Share on other sites More sharing options...
aznjay Posted September 12, 2008 Author Share Posted September 12, 2008 Can someone code this for me please? It'll be appreciated. Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 You mean error reporting? Sure. Add: ini_set('error_reporting', E_ALL); ini_set('display_errors','On'); at the very beginning of your script. Then we will see if there are any errors that prevent script from working as intended. Quote Link to comment Share on other sites More sharing options...
revraz Posted September 12, 2008 Share Posted September 12, 2008 Your logic makes absolutely no sense. Quote Link to comment Share on other sites More sharing options...
aznjay Posted September 12, 2008 Author Share Posted September 12, 2008 Here is the error : Undefined index: page in /home/jayjay/public_html/phptuts.php on line 20 Sorrie i'm a newbie at php programming..thats why i need expertz Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 Now we're getting somewhere Could you post what's on line 20 in your script? 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.