muramura Posted May 16, 2006 Share Posted May 16, 2006 I have used this code to connect and retrieve data from the database<?php//address error handling.ini_set('display_errors',1);error_reporting(E_ALL & ~E_NOTICE);//connect and select.if( $dbc = mysqli_connect ('localhost', 'traineework', 'password', 'traineework'))//define the query$query = 'SELECT * FROM cvs order by created desc';IF ($r = mysqli_query ($dbc, $query)){while ($row = mysqli_fetch_array ($r)){echo "<p><h3>{$row['profession']}</h3> <a href=\"cv_text.php?cv_text = $cv_text \">{$row['headline']}</a> </p>\n";}}else{die ('<p>could not select the database because:<b>' .mysqli_error($dbc). '</b></p>');}mysqli_close($dbc);?>My problem now is to provide a link to a page that will display the corresponding full text. For examlpe from the above code I would like the headline link to take one to the cv_text.php page that will have the rest of the text/article, the text/article is under column cv-text in my database.This is the code in cv_text.php <?phpini_set('display_errors',1);error_reporting(E_ALL & ~E_NOTICE);$cv_text = $_GET['cv_text'];print '<p>$cv_text</p>';?>But is gives me a blank page. I hope this explains my problem. Link to comment https://forums.phpfreaks.com/topic/9814-retreiving-information-from-database/ Share on other sites More sharing options...
ryanlwh Posted May 16, 2006 Share Posted May 16, 2006 what does $cv_text contain? it might have some special character that messed up the url Link to comment https://forums.phpfreaks.com/topic/9814-retreiving-information-from-database/#findComment-36397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.