Cardale Posted October 2, 2007 Share Posted October 2, 2007 function OTHERLINKS(){ PRINT "<table class=\"main\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\"><tr><td class=\"con2\" width=\"100%\"><b>Other links Currently in your database.</b></td></tr></table>"; global $db, $vp_e, $vp_options, $prefix, $language; $lsQuery1 = "SELECT * FROM ".$prefix['linksectionprefix']." ORDER BY ls_id"; $lsQueryresult1 = $db->query($lsQuery1) or $vp_e->F_ERROR('SELECT Error', $lsQuery1, __LINE__, __FILE__); while($lsRow1=$db->fetch_assoc($query)){ $ls_id = $lsRow1["ls_id"]; $ls_name = $lsRow1["ls_name"]; $ls_description = $lsRow1["ls_description"]; $ls_pic = $lsRow1["ls_pic"]; $ls_hitout = $lsRow1["ls_hitout"]; $ls_active = $lsRow1["ls_active"]; if($_SESSION['editpermission']=="true" && $ls_active=="0"){ $activatelink = "( <a href=\"index.php?ls_id=$ls_id&&activedvlinks=set&&managelinks\">Activate</a> )"; }elseif($_SESSION['editpermission']=="true" && $ls_active=="1"){ $activatelink = "( <a href=\"index.php?ls_id=$ls_id&&adeactivatevlinks=set&&managelinks\">Deactivate</a> )"; } if($_SESSION['deletepermission']=="true"){ $deletelink = "( <a href=\"index.php?ls_id=$ls_id&&adeletevlinks=set&&managelinks\">Delete</a> )"; }else{ $deletelink = " "; } echo "<table class=\"main\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\"><tr class=\"head\"><td class=\"head\" width=\"100%\" colspan=\"2\">$ls_name( <a href=\"$ls_name\" target=\"_blank\">View Page</a> ) $activatelink $deletelink</td></tr>"; echo "<tr><td class=\"con2\" width=\"50%\"><b>Description:</b> $ls_description</td>"; echo "<td class=\"con1\" width=\"50%\"><center><b>Picture</b><br /><img src=\"$ls_pic\"></center></td></tr></table>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/ Share on other sites More sharing options...
Cardale Posted October 2, 2007 Author Share Posted October 2, 2007 Does anyone see any reason why this shouldn't work? Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-359869 Share on other sites More sharing options...
d.shankar Posted October 2, 2007 Share Posted October 2, 2007 I hope it works now. function OTHERLINKS(){ PRINT "<table class=\"main\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\"><tr><td class=\"con2\" width=\"100%\"><b>Other links Currently in your database.</b></td></tr></table>"; global $db, $vp_e, $vp_options, $prefix, $language; $lsQuery1 = "SELECT * FROM ".$prefix['linksectionprefix']." ORDER BY $ls_id"; $lsQueryresult1 = $db->query($lsQuery1) or $vp_e->F_ERROR('SELECT Error', $lsQuery1, __LINE__, __FILE__); while($lsRow1=$db->fetch_assoc($query)){ $ls_id = $lsRow1["ls_id"]; $ls_name = $lsRow1["ls_name"]; $ls_description = $lsRow1["ls_description"]; $ls_pic = $lsRow1["ls_pic"]; $ls_hitout = $lsRow1["ls_hitout"]; $ls_active = $lsRow1["ls_active"]; if($_SESSION['editpermission']=="true" && $ls_active=="0"){ $activatelink = "( <a href=\"index.php?ls_id=$ls_id&&activedvlinks=set&&managelinks\">Activate</a> )"; }elseif($_SESSION['editpermission']=="true" && $ls_active=="1"){ $activatelink = "( <a href=\"index.php?ls_id=$ls_id&&adeactivatevlinks=set&&managelinks\">Deactivate</a> )"; } if($_SESSION['deletepermission']=="true"){ $deletelink = "( <a href=\"index.php?ls_id=$ls_id&&adeletevlinks=set&&managelinks\">Delete</a> )"; }else{ $deletelink = " "; } echo "<table class=\"main\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\"><tr class=\"head\"><td class=\"head\" width=\"100%\" colspan=\"2\">$ls_name( <a href=\"$ls_name\" target=\"_blank\">View Page</a> ) $activatelink $deletelink</td></tr>"; echo "<tr><td class=\"con2\" width=\"50%\"><b>Description:</b> $ls_description</td>"; echo "<td class=\"con1\" width=\"50%\"><center><b>Picture</b><br /><img src=\"$ls_pic\"></center></td></tr></table>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-359881 Share on other sites More sharing options...
Cardale Posted October 3, 2007 Author Share Posted October 3, 2007 No good. I'm not sure what you did but it didn't fix anything. I did find one problem, but that didn't fix it either. There is something wrong with the connection. Here is my error message. Error @: SELECT * FROM linksection ORDER BY ls_id There was a SELECT error, query invalid. function OTHERLINKS(){ PRINT "<table class=\"main\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\"><tr><td class=\"con2\" width=\"100%\"><b>Other links Currently in your database.</b></td></tr></table>"; global $db, $vp_e, $vp_options, $prefix, $language; $lsQuery1 = "SELECT * FROM ".$prefix['linksectionprefix']." ORDER BY ls_id"; $lsQueryresult1 = $db->query($lsQuery1) or $vp_e->F_ERROR('SELECT Error', $lsQuery1, __LINE__, __FILE__); while($lsRow1=$db->fetch_assoc($lsQueryresult1)){ $ls_id = $lsRow1["ls_id"]; $ls_name = $lsRow1["ls_name"]; $ls_description = $lsRow1["ls_description"]; $ls_pic = $lsRow1["ls_pic"]; $ls_hitout = $lsRow1["ls_hitout"]; $ls_active = $lsRow1["ls_active"]; if($_SESSION['editpermission']=="true" && $ls_active=="0"){ $activatelink = "( <a href=\"index.php?ls_id=$ls_id&&activedvlinks=set&&managelinks\">Activate</a> )"; }elseif($_SESSION['editpermission']=="true" && $ls_active=="1"){ $activatelink = "( <a href=\"index.php?ls_id=$ls_id&&adeactivatevlinks=set&&managelinks\">Deactivate</a> )"; } if($_SESSION['deletepermission']=="true"){ $deletelink = "( <a href=\"index.php?ls_id=$ls_id&&adeletevlinks=set&&managelinks\">Delete</a> )"; }else{ $deletelink = " "; } echo "<table class=\"main\" cellpadding=\"4\" cellspacing=\"1\" width=\"100%\"><tr class=\"head\"><td class=\"head\" width=\"100%\" colspan=\"2\">$ls_name( <a href=\"$ls_name\" target=\"_blank\">View Page</a> ) $activatelink $deletelink</td></tr>"; echo "<tr><td class=\"con2\" width=\"50%\"><b>Description:</b> $ls_description</td>"; echo "<td class=\"con1\" width=\"50%\"><center><b>Picture</b><br /><img src=\"$ls_pic\"></center></td></tr></table>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-360550 Share on other sites More sharing options...
d.shankar Posted October 3, 2007 Share Posted October 3, 2007 No good. I'm not sure what you did but it didn't fix anything. I did find one problem, but that didn't fix it either. There is something wrong with the connection. Here is my error message. Error @: SELECT * FROM linksection ORDER BY ls_id There was a SELECT error, query invalid. Yea it should spit the error ! What is ls_id and where have you defined it ???? Thats why in the last code i posted i changed the ls_id to $ls_id. Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-360575 Share on other sites More sharing options...
Cardale Posted October 4, 2007 Author Share Posted October 4, 2007 ls_id is a column is the MYSQL database. Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-361445 Share on other sites More sharing options...
trq Posted October 4, 2007 Share Posted October 4, 2007 Do you want to actually explain what you expect to happen and what is happening? You might also want to take a read of the Howto ask.... link in my signiture, your not making it at all easy for anyone to help you. Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-361455 Share on other sites More sharing options...
Cardale Posted October 4, 2007 Author Share Posted October 4, 2007 well I know your a genius and everything, but all its suppose to do is read some info from the database and display it. I know there is a couple objects there that could throw you off, but didnt think I would have to explain it to some one sorry about that. Whats confusing I look at my stuff so much I dont know? Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-361466 Share on other sites More sharing options...
d.shankar Posted October 4, 2007 Share Posted October 4, 2007 well I know your a genius and everything, but all its suppose to do is read some info from the database and display it. I know there is a couple objects there that could throw you off, but didnt think I would have to explain it to some one sorry about that. Whats confusing I look at my stuff so much I dont know? Cardale.. Please try to behave infront of supermods and others. Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-361499 Share on other sites More sharing options...
Cardale Posted October 5, 2007 Author Share Posted October 5, 2007 My bad. Appreciate the help guys. Quote Link to comment https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/#findComment-362211 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.