mmarif4u Posted July 2, 2007 Share Posted July 2, 2007 Ok try to edit ur code to this: f ($_GET['show'] == 1){$query = "SELECT * FROM piccomment WHERE picid = '$pictureid' ORDER BY picindex asc ";} And let me know. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287800 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 Unfortuneately that still is not doing it. Thank you for your patience so far. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287801 Share on other sites More sharing options...
mmarif4u Posted July 2, 2007 Share Posted July 2, 2007 Ok try it with out order by clause: if ($_GET['show'] == 1){$query = "SELECT * FROM piccomment WHERE picid = '$pictureid'";} Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287802 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 try this please. if ($_GET['show'] == 1){$query = "SELECT * FROM `piccomment` WHERE `picid` = '$pictureid' ORDER BY `commentdatetime` DESC ";} if ($_GET['show'] != 1) {$query = "SELECT * FROM `piccomment` WHERE `picid` = '$pictureid' ORDER BY `commentdatetime` DESC LIMIT 7 ";} query_db($query); Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287804 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 Still not doing it. This is pretty frustrating isn't it? I have been working on this all day! Do you think it has something to do with my db, and not the code at all? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287805 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 That didn't solve the issue either redarrow. It is still working after your changes though, so that is good. Would you like me to PM you a username and password to see what it happening? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287809 Share on other sites More sharing options...
mmarif4u Posted July 2, 2007 Share Posted July 2, 2007 i did not think u change ur code to this: if ($_GET['show'] == 1){$query = "SELECT * FROM piccomment WHERE picid = '$pictureid'";} Bcoz i did not the comment i posted now. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287811 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 I did and tested it, when it didnt work I put it back, If you would like I will put it back to what you have posted above for you to try...so i am doing it now, let me know what you get. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287813 Share on other sites More sharing options...
mmarif4u Posted July 2, 2007 Share Posted July 2, 2007 Read this link: http://bugs.mysql.com/bug.php?id=28542 Thats why i remove order by clause from your query. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287814 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 So that did actually work, I was still looking at the top of the comments list for the latest post, I forgot that it would add it at the bottom. So does that mean I cant order the posts now? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287816 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 I take that back it works for every post after the first. The first post on a pic still doesnt show. edit: I continued to try on other photos, and it is back to not showing the latest post at all. I know this can work, Im sure theres a more elegant solution especially using ajax or something, but I think what I have is close to working, or should I be going about this a different way? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287817 Share on other sites More sharing options...
mmarif4u Posted July 2, 2007 Share Posted July 2, 2007 U can use but depend on your mysql version. Order by is the way to put the latest one on top but here u r using version 4.1.22 so may be still the mysql team did not fix it for version 4.1.22, But later versions works fine for order by. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287820 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 are you posting the pic to another file.php or the same file.php Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287821 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 are you posting the pic to another file.php or the same file.php Im not sure what you are asking redarrow? U can use but depend on your mysql version. Order by is the way to put the latest one on top but here u r using version 4.1.22 so may be still the mysql team did not fix it for version 4.1.22, But later versions works fine for order by. Unfortuneately I have no control over my verson Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287824 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 post you insert code please ok. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287825 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 for inserting comments or photos? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287826 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 Here is the comment insert form <?php include("db_connect.php"); $striptext = stripslashes(strip_tags($_POST['text'])); $finaltext = mysql_real_escape_string($striptext); $now = date("Y-m-d H:i:s"); $query = "INSERT INTO piccomment (picid,posterid,commentdatetime,postername,comment) VALUES ('$_POST[picid]','$_SESSION[user]','$now','$_POST[postername]','$finaltext')"; query_db($query); $getid = $_POST['picid']; header("location:pic.php?id=$getid"); ?> Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287827 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 try this ok. <?php $picid=addslashes($_POST['picid']); $users=addslashes($_SESSION['user']); $users=addslashes($_POST['user']); $postername=addslashes($_POST['postername']); $striptext = stripslashes(strip_tags($_POST['text'])); $finaltext = mysql_real_escape_string($striptext); $now = date("Y-m-d H:i:s"); $query = "INSERT INTO piccomment (picid,posterid,commentdatetime,postername,comment) VALUES ('$picid','$user','$now','$postername','$finaltext')"; query_db($query); $getid = $_POST['picid']; header("location:pic.php?id=$getid"); ?> Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287830 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 updated version <?php $picid=$_POST['picid']; $users=$_SESSION['user']; $users=$_POST['user']; $postername=$_POST['postername']; $striptext = stripslashes(strip_tags($_POST['text'])); $finaltext = mysql_real_escape_string($striptext); $now = date("Y-m-d H:i:s"); if(isset($_POST['submitcomment'])){ $query = "INSERT INTO piccomment (picid,posterid,commentdatetime,postername,comment) VALUES ('$picid','$user','$now','$postername','$finaltext')"; query_db($query); } $getid = $_POST['picid']; header("location:pic.php?id=$getid"); ?> Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287832 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 I still am getting the same lag, the latest post still doesn't show until another post has been made. I will try that latest version now. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287833 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 from the database what is the table field set to varchar char lontext what? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287834 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 you have $users being set to two different things, and in the query $user isnt coming from anywhere Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287838 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 Here are my columns and data types picindex int picid int posterid int commentdatetime datetime postername varchar comment text Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287841 Share on other sites More sharing options...
redarrow Posted July 2, 2007 Share Posted July 2, 2007 sorry about the typo i am stuffed then that me sorry. Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287844 Share on other sites More sharing options...
bluebyyou Posted July 2, 2007 Author Share Posted July 2, 2007 No problem, I apreciate the patience and help. would you mind posting what it should have been? Link to comment https://forums.phpfreaks.com/topic/58041-solved-data-from-database-lag/page/2/#findComment-287845 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.