Allenj713 Posted November 3, 2008 Share Posted November 3, 2008 I'm kind of a beginner so bear with me here. Ive just created an Administrative Control Panel for a site and also set up most of the front end code to pull up the info onto the page. But I'm having a small problem with my links, when called they don't display as a link but just as plain text. Here's my base code if anyone knows what you add to preserve the URL when calling it up. <?php // open connection to MySQL server $connection = mysql_connect('localhost', 'guest', 'tQIfkRS3') or die ('Unable to connect!'); // select database for use mysql_select_db('guest') or die ('Unable to select database!'); // create and execute query $query = 'SELECT * FROM links'; $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); // check if records were returned if (mysql_num_rows($result) > 0) { // iterate over record set // print each field while($row = mysql_fetch_row($result)) { echo $row[0] . " - " . $row[1] . "\n"; } } else { // print error message echo 'No rows found!'; } // once processing is complete // free result set mysql_free_result($result); // close connection to MySQL server mysql_close($connection); ?> Quote Link to comment https://forums.phpfreaks.com/topic/131148-database-url-issue/ Share on other sites More sharing options...
corbin Posted November 3, 2008 Share Posted November 3, 2008 an <a> tag? Quote Link to comment https://forums.phpfreaks.com/topic/131148-database-url-issue/#findComment-680931 Share on other sites More sharing options...
Allenj713 Posted November 3, 2008 Author Share Posted November 3, 2008 Haha, ok where does it go and what does it do? Quote Link to comment https://forums.phpfreaks.com/topic/131148-database-url-issue/#findComment-680936 Share on other sites More sharing options...
corbin Posted November 3, 2008 Share Posted November 3, 2008 http://www.w3schools.com/tags/tag_a.asp Quote Link to comment https://forums.phpfreaks.com/topic/131148-database-url-issue/#findComment-680945 Share on other sites More sharing options...
Allenj713 Posted November 3, 2008 Author Share Posted November 3, 2008 Ok ill clarify. The control panel submits the "name" and "url" to the database. I need a code that will bring them all up correctly on the web page, and not with specific <a href> tags because the links will be ever changing. And bring them up as links, and not text. Quote Link to comment https://forums.phpfreaks.com/topic/131148-database-url-issue/#findComment-680949 Share on other sites More sharing options...
fenway Posted November 3, 2008 Share Posted November 3, 2008 Ok ill clarify. The control panel submits the "name" and "url" to the database. I need a code that will bring them all up correctly on the web page, and not with specific <a href> tags because the links will be ever changing. And bring them up as links, and not text. Is your DB query working? Because this sounds like a PHP issue. Quote Link to comment https://forums.phpfreaks.com/topic/131148-database-url-issue/#findComment-681452 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.