Jump to content

MartinaL

Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MartinaL's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have some information which I am displaying on a PHP page from a MySQL database. One of them is a date and it comes back in the format 2006-03-17, but I want it to display to the screen in the format 17 March. Is this possible?
  2. I updated but still no luck, nothing at all is displayed on the page. I'm fairly new to PHP so to check each line to see if it fails how do I do this?
  3. I want to display some rows from a MySQL database in a php page in the following format; Each row should be displayed one after the other like this. column 1 is called Date, 2 is called Heading and 3 is called Content ----- Date - Heading Content I have tried setting this up with the following piece of code but nothing is being displayed on the screen at all; [code]<?php           $dbhost = 'localhost';         $dbuser = 'dhopec';         $dbpass = '<<MY PASSWORD>>';         $dbname = 'dhopec_com_-_content';         $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');         mysql_select_db($dbname);                    $query_string = "select Date, Heading, Content from news";         $result = mysql_query($query);                  $num=mysql_numrows($result);                  mysql_close();         echo "<table><tr><td colspan="2"><b>Database Output</b></td></tr>";         $i=0;         while ($i < $num) {                  $Date=mysql_result($result,$i,"Date");         $Heading=mysql_result($result,$i,"Heading");         $Content=mysql_result($result,$i,"Content");                  echo "<tr><td><b>$Date</td><td>$Heading</td></tr><tr><td colspan="2">$Content</td></tr></table>";                  $i++;         }         ?>[/code]
×
×
  • 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.