Jump to content

Recommended Posts

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>";
  }

}

Link to comment
https://forums.phpfreaks.com/topic/71486-see-a-problem-with-this/
Share on other sites

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>";
  }

}

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>";
  }

}

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.

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?

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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.