Jump to content

Recommended Posts

Hi there. i have a php script that grabs information from database, but it does not. In my forum I gave users gifts as in small picture, it does write it to db, it also shows on profile 'Award:1" . but when I click on the award to see it, it states that there is no award.

 

Here is the code on that page where awards should be display'd. Please help.

 

<?php
require "../conf_global.php";
$nawards = "";
$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver'];
$to_require = "../sources/Drivers/".$INFO['sql_driver'].".php";
require ($to_require);
$DB = new db_driver;
$DB->obj['sql_database']	 = $INFO['sql_database'];
$DB->obj['sql_user']		 = $INFO['sql_user'];
$DB->obj['sql_pass']		 = $INFO['sql_pass'];
$DB->obj['sql_host']		 = $INFO['sql_host'];
$DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
// Get a DB connection
$DB->connect();
if (isset($mid)) {
$query=$DB->query("select * from ibf_awards where mid = '$mid'");
$nawards=mysql_num_rows($query);
$userinfo=mysql_query("select * from ibf_members where id = '$mid'");
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>awards</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel='stylesheet' href='../style_sheets/stylesheet_1.css' type='text/css'>
</head>
<body bgcolor="#FFFFFF" vlink='#000000' alink='#000000' leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
<br>
<?
if ($nawards>"0")
{
?>
<table width="95%" border="0" bgcolor="#000000" cellspacing="0" cellpadding="1">
<tr>
<td width="100%" bgcolor="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="1" background='../style_images/1/tile_back.gif' id='maintitleback'>
    <tr>
	  <td width="100%" colspan="4" id="maintitle" align="center"><strong>Awards for <? echo mysql_result($userinfo, 0, 'name'); ?></strong></td>
    </tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#999999">
   <tr>
   <td width="20%" align="center" nowrap id='titlemedium' background='../style_images/1/tile_sub.gif'><strong>title</strong></td>
   <td width="25%" align="center" nowrap id='titlemedium' background='../style_images/1/tile_sub.gif'><strong>picture</strong></td>
   <td width="15%" align="center" nowrap id='titlemedium' background='../style_images/1/tile_sub.gif'><strong>from:</strong></td>
   <td width="40%" align="center" nowrap id='titlemedium' background='../style_images/1/tile_sub.gif'><strong>description</strong></td>
    </tr>
<?
for ($r=0; $r<$nawards; $r++)
{
?>
    <tr>
   <td width="20%" id="forum2" align="center"><? echo mysql_result($query, $r, 'awardtitle'); ?></td>
   <td width="25%" id="forum2" align="center"><img src="../html/awards/<? echo mysql_result($query, $r, 'awardimg'); ?>" alt=""></td>
   <td width="15%" id="forum2" align="center"><? echo mysql_result($query, $r, 'cid'); ?></td>
   <td width="40%" id="forum2" align="center"><? echo mysql_result($query, $r, 'description'); ?></td>
    </tr>
<?
}
?>
 <tr>
	  <td width="20%" id='mainfoot'> </td>
   <td width="25%" id='mainfoot'> </td>
   <td width="15%" id='mainfoot'> </td>
   <td width="40%" id='mainfoot'> </td>
    </tr>
</table>
</td></tr>
</table>
<?
}
else echo "<font size=\"2\" face=\"Tahoma, Verdana, Arial, sans-serif\"><strong>this user have no awards</strong></font>";
?>
<br>
<font size="1" face="Tahoma, Verdana, Arial, sans-serif"><a href="javascript:close()">close window.</a></font>
</center>
</body>
</html>
<? $DB->close_db(); ?>

Link to comment
https://forums.phpfreaks.com/topic/269719-cant-grab-information-from-db/
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.