PHP & MySQL Question

Soldato
Joined
1 Dec 2004
Posts
22,747
Location
S.Wales
You know you have to create a php frontend for the database, well i have done that on a new blank page and its displaying data from the database, if i wanted to integrate this onto a page i have already designed..And more specifically in a specified content div..can i do this??

How do i add php script to an already coded xhtml page?
 
You can embed PHP anywhere in a page. Just rename it to .php and use the usual <?php ... ?> tags wherever you need them.
 
you just put the content inside the div..
Code:
<div class="table">
    <table>
        <tr><th>col1</th><th>col2</th><th>t3</th></tr>
<?php
while ($row = mysql_fetch_assoc($result)) {
    echo "\t\t<tr><td>" . htmlentities($row['col1']) . '</td><td>' . htmlentities($row['col2']) . '</td><td>' . htmlentities($row['col3']) . "</td></tr>\n";
}
?>    </table>
</div>
 
Done, but anyone see any reason to make it flicker and not display menu items properly?

Edit: A new discovery, the problem only occours in firefox browser aswel, works fine in IE
 
Last edited:
Sorry mate, I've got exp with PHP but when it came to MySQL I couldn't get the damn thing working. Just really weird. I have since then forgotton all knowledge. Probably could back easy enough though.
 
The flickering is nowt to do with PHP or MySQL I'm afraid.. that's down to browsers interpretation of (X)HTML and/or JavaScript.
 
Back
Top Bottom