Jump to content

problem displaying result !


simzam

Recommended Posts

i cannot figure out why my first result is not displaying properly it successfully shows all results but me first

myurl.com/other.php?id=2 now showing any thing kindly help to solved this problem!  :shrug:

 

it seems like problem is in variable $http$ids but dunno how to combine them to get result $Ids always b numeric number

 

<?php
ini_set ("display_errors", "1"); 
error_reporting(E_ALL);

$http = "myurl.com/other.php?id=" ;

$conn=odbc_connect('greeting','','');
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM mytable";
$rs=odbc_exec($conn,$sql);
if (!$rs)
  {exit("Error in SQL");}
echo "<table border= 1><tr>";
echo "<th>ID</th>";
echo "<th>Like</th>";
echo "<th>title</th></tr>";
while (odbc_fetch_row($rs))
  {
  $ids=odbc_result($rs,"ID");
  $title=odbc_result($rs,"title");
  echo "<tr><td>$ids</td>";
  echo "<td><fb:like href=\"$http$ids\" layout=\"button_count\"  show_faces=\"false\" width=\"100\" font=\"tahoma\" colorscheme=\"dark\"></fb:like> </td>";
  echo "<td>$title</td></tr>";
  }
echo "</table>";
odbc_close($conn);
?>

Link to comment
Share on other sites

  echo "<td><fb:like href=\"$http$ids\" layout=\"button_count\"  show_faces=\"false\" 
width=\"100\" font=\"tahoma\" colorscheme=\"dark\"></fb:like> </td>";

 

Since you are trying to combine variables INSIDE of a double-quoted string, the dot (".") concatenation is not the answer. You need to separate the variables with curly-braces so PHP will know that they are two separate variables.

 

  echo "<td><fb:like href=\"{$http}{$ids}\" layout=\"button_count\"  show_faces=\"false\" 
width=\"100\" font=\"tahoma\" colorscheme=\"dark\"></fb:like> </td>";

 

Link to comment
Share on other sites

there is only 2 fields in database ID AND Title

yes ID=2 and title = sometext

and all links work fine but when it comes to id=2 link not seem to b OK  but now i changed ID to Link and it start working but i wanted to know why it didn't not worked with ID

Link to comment
Share on other sites

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.