
June 20th, 2008, 08:03 PM
|
|
Registered User
|
|
Join Date: Mar 2008
Posts: 5
Time spent in forums: 1 h 39 m 32 sec
Reputation Power: 0
|
|
|
Profile problem (PHP, mySQL, Javascript)
Hey everyone,
I've run into an issue on my most recent project; shantiyoga.ca, the instructors page glitches out maybe 1/10 times - I can't see the problem, but a refresh always seems to sort things out.
PHP Code:
<?php
$query = "SELECT *
FROM instructors
ORDER BY instructor_name ASC";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
?>
<div class="instructors">
<!-- normal state -->
<a class="instructor" href="javascript:;" onmousedown="toggleSlide(<?php echo $row['instructor_id'];?>);">
<p class="instructor_name">
<?php echo $row['instructor_name'];?>
</p>
<div id="instructor_thumb">
<?php
echo "<img src=\"$path_instructor_img".$row['instructor_smallimg']."\"/>";
?>
</div><!--/instructor_thumb-->
</a>
<?php if(isset($_SESSION['admin'])){?>
<p class="manage_instructors">
<a href="index.php?id=admin_instructor_delete&postid=<?php echo $row['instructor_id'];?>">Delete</a>
</p>
<?php } //session ?>
<!-- expanded state -->
<div id="<?php echo $row['instructor_id'];?>"
style="display:none;
overflow:hidden;
border-right: solid black 1px;
border-bottom: solid black 1px;
border-left: solid black 1px;
width: 535px;
height: 335px;
margin: 0 auto;">
<div class="instructor_profile">
<?php echo $row['instructor_profile'];?>
</div><!--/instructor_profile-->
<div id="instructor_photo">
<?php
echo "<img src=\"$path_instructor_img".$row['instructor_largeimg']."\"/>";
?>
</div><!--/instructor_photo-->
</div><!--/dynamic-->
</div><!--/instructors-->
<?php }//while ?>
I'm pretty new to working with multiple languages, and as a result my standards have gotten sloppy. I'd like to get this validating, but I'm running into two main issues: The div's are named after primary keys in the database, and i've got <p> and <div> within <a>.
Any guidance would be greatly appreciated, I'm at a loss as to why the page is randomly flailing - I figured I would start with validation
|