mark103 Posted April 4, 2013 Share Posted April 4, 2013 Hi guys,I need your help. I have stored the information in mysql database where I can print it out in my php using with this following code: <?php session_start(); define('DB_HOST', 'localhost'); define('DB_USER', 'mydbusername'); define('DB_PASSWORD', 'mydbpassword'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />',$errmsg_arr); } else { $qrytable1="SELECT id, channels FROM tvguide"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { echo "</br>"; echo "<td>".$row['channels']."</td>"; echo "</br>"; } } ?> Now I want to know how I can output the data from php to html, do you know how?if you do then i need your help.thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/276510-how-to-output-the-data-from-php-to-html/ Share on other sites More sharing options...
mark103 Posted April 4, 2013 Author Share Posted April 4, 2013 can anyone help me please?????? Quote Link to comment https://forums.phpfreaks.com/topic/276510-how-to-output-the-data-from-php-to-html/#findComment-1422877 Share on other sites More sharing options...
Technocrat Posted April 4, 2013 Share Posted April 4, 2013 I dont think your question is clear. You are already out putting to HTML. Do you want to create an entire page around it? like tv.html? If so you can do one of two things. First is to create a php file with this code inserted into the area you wanted. Then using mod_rewrite, rewrite your tv.html to your tv.php file. Second you can export all this data to a file your create using like file_put_content Quote Link to comment https://forums.phpfreaks.com/topic/276510-how-to-output-the-data-from-php-to-html/#findComment-1422880 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.