Another error
Posted: Tue Jun 22, 2004 10:39 am
Can anyone help with this one?
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in c:\program files\apache group\apache\storegroup\sg_forum\joint_venture_admin.php on line 36
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in c:\program files\apache group\apache\storegroup\sg_forum\joint_venture_admin.php on line 36
Query failed:
Code: Select all
$linkid = @mysql_connect('localhost', 'seekide_si', '*password is correct*');
mysql_select_db('seekide_sgforum', $linkid);
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
if (!isset($mode)) $mode = '';
$mode = $_GET['mode'];
echo $mode;
/* MODES: create | edit | view | approve | print |Send */
// MODE: CREATE
//function create_contract()
//{
// Redirect to contract, CREATE MODE
//redirect("joint_venture_contract.php?mode=create");
//}
// MODE: EDIT
function edit_contract() {
// now to output the form HTML.
// Redirect to contract, CREATE MODE
$user_id = $userdata['user_id'];
$sql1 = 'SELECT `contract_id` , `user_id_1` , `user_id_2` , `user_id_3` , `user_id_4` , `venture_id` , `vdesc` , `status` , `post_date` '
. ' FROM `venture_contract` '
. ' WHERE user_id_1 = '.$user_id.' OR user_id_2 = '.$user_id.' OR user_id_3 = '.$user_id.' OR user_id_4 = '.$user_id.' ORDER BY post_date DESC';
***LINE 36*** $result1 = mysql_query($sql1, $linkid) or die("Query failed: " . mysql_error($linkid));
if(mysql_num_rows($result1) == 0){
echo("<br><center><span class='genmed'><font size='2' color='red'><b>You have NO Venture Contracts Created.</b></font></span></center>");
}else{
echo ("<br><table width='95%' cellpadding='2' cellspacing='1' border='0' class='forumline' align='center'><tr><th class='catleft' colspan='2' height='22' align='left'><img src='templates/phpib2/images/nav.gif'><span class='thCornerL'> EDIT CONTRACT MODE: Select a Venture Contract to EDIT</a></span></th></tr>
<tr>
<td class='row1'>
<span class='genmed'>");
}
// Display results for edit mode
while ($row1 = mysql_fetch_array($result1))
{
echo ("<br><a href='http://www.storegroup.org/sg_forum/joint_venture_contract.php?mode=edit&user_id=".$user_id."&contract_id=".$row1['contract_id']."'>EDIT</a> Venture Type: ".$row1['venture_id']." Post Date:".$row1['post_date']." Contract Status: ".$row1['status']."<br>Venture Description: ".$row1['vdesc']."<br>Contract Participants: ");
// Get usernames of contract participants
$sql2 = 'SELECT username'
. ' FROM sgforum_users'
. ' WHERE user_id'
. ' IN ( '.$row1['user_id_1'].', '.$row1['user_id_2'].', '.$row1['user_id_3'].', '.$row1['user_id_4'].' ) LIMIT 0, 30';
$result2 = mysql_query($sql2, $linkid) or die("Query failed: " . mysql_error($linkid));
while ($row2 = mysql_fetch_array($result2)) {
echo ($row2['username'].", ");
}
echo ("<br><br>");
}
echo ("</span></td></tr></table>");
}