You need to shore up your HTML a bit... you're using an article2 tag, which isn't actually standard tag, which means browsers won't know what to do with it, and though there is an article tag in HTML5, you have your page defined as HTML4, so definitely needs to go.
As for the bug, if you replace the include with "echo 1;", does it work? It sounds like your PHP isn't running... does other PHP code work on that page?
// set up strings needed to connect to the DB
$DBhost = "*****";
// Connect to mysql here or die
$connect = mysql_connect($DBhost,$username,$password) or die("Unable to connect to host");
// Connect to the database you want here or die
mysql_select_db($database) or die( "Unable to connect database");
$sql = "SELECT * FROM barlist WHERE bar_city like '%Murfreesboro%' ";
//echo "<hr/>DEBUG SQL: " . $sql . "<hr/>\n";
$result = mysql_query( $sql ) or die( mysql_error() );
echo "<table border='1'>
while($row = mysql_fetch_array($result))
echo "<td>" . $row['bar_name'] . "</td>";
echo "<td>" . $row['bar_city'] . "</td>";
echo "<td>" . $row['bar_open'] . "</td>";
echo "<td>" . $row['bar_close'] . "</td>";
Ok I figured it out... you were correct in saying that the page had to be a .php before it would work when I renamed the file to a .php it didnt work because when I went to save it I saved it as unicode instead of utf-8 encoding. Once I saved the file as utf-8 encoding and I changed the php line back to
<?PHP include "getdata.php"; ?>
it worked fine the table shows on the page like it should.. thank you guys for all of your help! I am sure I will be back with more questions later. Just glad I have a great place to get some help! Thanks again!
If you need 2 article tags (which plenty of people do, just look at a blog), you use unique identifiers.
<article> tells the browser the following is meant to be an article, so the browser developers have come up with CSS that would match that be default. It also makes it easier to read. <article2> tells YOU that this is a different article, but as far as the browser is concerned, there is no difference between two articles.... or headers or links, etc. If you need to distinguish between two tags, use the id attribute:
After all, you wouldn't make a <div>, <div2>, <div3>, right?
Valid code is VERY important, specially if you're going cross browser. Your code wouldn't appear correct at all in IE prior to 9, would fail in FF prior to 3 (I believe, maybe its 3.5, can't remember when they added the default tag css), etc. Validate, it'll save you time and hassle.
By giving them default CSS, newer browsers will understand what to do with them, but for example, HTML5 tags prior to IE9 won't know what to do with them, no matter how much css you apply (to make HTML5 tags work on older browsers, make use of a html5 shiv). Its a bad habit to make up your own tags. There is a reason there is a standard; it makes development easier, and avoids issues. Even if everything appears to be working fine, deviation from standards could be why something stops working. Besides, your current definition isn't sufficient. What is its display definition for example? There is never a reason to make up a tag when the standards give you an alternative.
It doesn't matter what file the CSS is in, as long as its applied. PHP is all backend... the user never sees any of it. Just the same, CSS is all frontend, the server couldn't care less about it. When you include a file within another file and serve it to the user, they only know they're getting one file. So even if you put each tag in a separate file, then included it all together, the user would think you sent them one file, with a bunch of tags on it, and any css that page references would apply. Its important to note what is processed on the back and the front.
Ok thanks for that. I got the getdata.php code working it pulls the bars with the word Murfreesboro in the bar_city field and it places them in the table like I am wanting if I browse to the getdata.php file manually it works but it is not displaying on my main page where I have the following code
<?PHP include("getdata.php"); ?>
And I hate to ask too many questions do any of you have any idea why a web page will show fine in IE9 but not in chrome?
try using the format phtml instead of html as it will most likely not work trying to put php in a client side file format.
Ok I have another question some of you might be able to answer.
On the getdata.php page I have it draw a table with results and what I am wantng to do is round the corners of that table.
I know you have to draw the ronded coners then place them over the table edges and I have the top left one working but it seems to mess with the layout of the table and the top right image is not stretching over to the actual coner of the table.. this is the code I have right now to draw the table.