Jump to content

Linking mysql database


aznjay

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/123958-linking-mysql-database/
Share on other sites

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...

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.

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.