Hi,
I found this great tut on how to do ajax pagination. The problem is that my situation is different that his and I cant get MYSQL code to work with this script.
Here is the link [url]http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm
On the second page he explains how to pull your data to paginate from a database… well I cant get mine to work.
here is the code that I want to use to generate the data….
[code]$query1 = “SELECT * FROM video WHERE video_username = ‘$username’ ORDER BY video_upload_date DESC LIMIT $startRow,”.SHOWMAX;
mysql_select_db($database_db294582132, $db294582132);
$result1 = mysql_query($query1, $db294582132) or die(mysql_error());
// loop through DB and get basic data
while($row1 = mysql_fetch_assoc($result1)){
$video_id = $row1[‘video_id’];
$thumb = $row1[‘video_t_filename’];
$video_title = $row1[‘video_title’];
$song_name = $row1[‘video_song_name’];
$song_artist = $row1[‘video_song_artist’];
$song_unknown = $row1[‘video_song_unknown’];
$caption = $row1[‘video_caption’];
$vehicle_id = $row1[‘vehicle_id’];
$video_setup = $row1[‘setup_id’];
$upload_date = date(“m.d.’y, g:i a”, strtotime($row1[‘video_upload_date’]));
//get vehicle info
if($vehicle_id ==!NULL){
$query2 = “SELECT * FROM user_vehicles WHERE vehicle_id = ‘$vehicle_id'”;
mysql_select_db($database_db294582132, $db294582132);
$result2 = mysql_query($query2, $db294582132) or die(mysql_error());
$row2 = mysql_fetch_assoc($result2);
$year = $row2[‘vehicle_year’];
$make = $row2[‘vehicle_make’];
$model = $row2[‘vehicle_model’];
}
if($setup_id ==!NULL){
//Get setup info
$query4 = “SELECT * FROM vehicle_setups WHERE setup_id = ‘$video_setup'”;
mysql_select_db($database_db294582132, $db294582132);
$result4 = mysql_query($query4, $db294582132) or die(mysql_error());
$row4 = mysql_fetch_assoc($result4);
$setup = $row4[‘setup’];
}
//provide format for uploaded videos section
echo
‘<div id=”shopVidsDiv”><div id=”editButtonDiv”><a href=”editVideos.php”>edit</a></div>
<div id=”vehicleDescriptionDiv”><div id=”title”><span class=”videoStatHeading”>TITLE: </span>’,$video_title,'</div><div id=”Caption”><span class=”videoStatHeading”>CAPTION: </span>
‘,$caption,'</div>
<div id=”song”><span class=”videoStatHeading”>SONG NAME: </span>’,$song_name,'<span class=”videoStatHeading”> ARTIST: </span>’,$song_artist,'</div><div id=”vehicle”><span class=”videoStatHeading”>VEHICLE: </span>’,$year,’ ‘,$make,’ ‘,$model,'</div><div id=”setup”><span class=”videoStatHeading”>SETUP: </span>’,$setup,'</div><div id=”uploadDate”><span class=”videoStatHeading”>UPLOADED ON: </span>’,$upload_date,'</div></div>
<img src=”images/videoThumbs/’,$thumb,’.jpg” width=”100″ height=”75″ alt=”‘,$caption,'” />
</div>’;
}
Any ideas on where to put that code into that pagination script correctly? This is my first site ever built and I highly appreciate the help. thanks