|
|
|
|
Joined: Jun 2001
Posts: 176
Member
|
|
Member
Joined: Jun 2001
Posts: 176 |
ok here is what I'm doing bbut only got so far I made an addon for the pals index page what it's doing to grabbing some links from mylinks database! now I have the connection string & even the select string but it's not printing out in the table I'm sure I did not do the display the links code right in php... here it is :
<br> <? require ("/home/pathhere/pals/aconfig.inc.php");
"SELECT link FROM links WHERE cat=15 ORDER BY link ASC LIMIT 0, 30 ";
"link=$link"; $html = new html;
$html -> open_table();
echo "<TR><TD ALIGN=Center VALIGN=TOP CLASS="tdheader">Our $affi Affiliates</TD></TR><TR><TD ALIGN=LEFT VALIGN=TOP CLASS="lighttable"><TABLE>"; echo "<TR><TD><a href='$link'></a></TD></TR>"; echo "</TABLE>";
$html -> close_table();
?>
now what did I not finish in order for them to display ? I'm only learning php so go easy on me
ok this is the way I have it now but no juice my connection string looks like this : $dbh=mysql_connect ("localhost", "username", "pass") or die ('some thing went belly up I cannot connect to the database.'); mysql_select_db ("db-name");
|
|
|
|
|
Joined: Oct 2000
Posts: 60
Power User
|
|
Power User
Joined: Oct 2000
Posts: 60 |
Change echo "<TR><TD><a href='$link'></a></TD></TR>"; to echo "<TR><TD><a href='$link'>$link</a></TD></TR>"; and see if you get anything.
|
|
|
|
|
Joined: Jun 2001
Posts: 176
Member
|
|
Member
Joined: Jun 2001
Posts: 176 |
|
|
|
|
|
Joined: Jun 2001
Posts: 176
Member
|
|
Member
Joined: Jun 2001
Posts: 176 |
ok I got it but my tables are messed up maybe you can help me here
<br> <? //database connection @ $db=mysql_connect("localhost","bd_name","password");
//error if can't connect if (!$db) { echo "Error: Something spit up we Could not connect to the database. Please tell Doorslammer he messed up."; exit; }
//lets select the database mysql_select_db("digitalb_mylinks");
// $result = mysql_query("SELECT * FROM links"); // $number_of_links = mysql_num_rows($result); // echo "<p>Number of link found: $number_of_links</p>"; // mysql_free_result($result); $html -> open_table(); echo "<TR><TD ALIGN=Center VALIGN=TOP CLASS="tdheader">Our $affi Affiliates</TD></TR><TR><TD ALIGN=LEFT VALIGN=TOP CLASS="lighttable"><TABLE>";
$result = mysql_query("SELECT * FROM links WHERE cat=16 ORDER BY link"); if ($result) { while ($row = mysql_fetch_array($result)) { $title = $row["title"]; $link = $row["link"];
// print my query
echo "<TR><TD><a href='$link'>$title</a><br>";
} }
echo "</TD></TR></TABLE>";
$html -> close_table(); ?>
btw this is an addon I made for daves index so I could display some links from the mythreads ? links script hehe code fixxed all don working great
if anyone wants this let me know (the above code is correct now
Last edited by Dslam; 02/13/2002 11:42 AM.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 253
Joined: January 2000
|
|
|
Forums63
Topics37,583
Posts293,957
Members13,826
| |
Most Online151,614 Nov 14th, 2025
|
|
Currently Online 5133
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 11
|
|
|
|
|
|