maroccano1
02-26-2009, 04:25 PM
I am very new to mysql, i have created the following code to run a query and obtain the results but keep getting this message
"mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in C:\inetpub\wwwroot\create_auction.inc.php on line 26"
i don't understand why??
<?php
include('header.html');
$user = $_SESSION['username'];
$userid = $_SESSION['userid'];
if(!session_is_registered('username')) {
echo "you must be logged in";
}else{
include('connect.php');
$track = $_POST['track'];
$month = $_POST['months'];
$week = $_POST['weeks'];
$rprice = $_POST['rprice'];
$q = "SELECT track_id FROM tracks WHERE username='$user' AND title = '$track'";
//$r = @mysqli_query ($dbc, $q);
$result = @mysqli_query($dbc, $q);
$row=mysqli_fetch_object($result);
}
"mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in C:\inetpub\wwwroot\create_auction.inc.php on line 26"
i don't understand why??
<?php
include('header.html');
$user = $_SESSION['username'];
$userid = $_SESSION['userid'];
if(!session_is_registered('username')) {
echo "you must be logged in";
}else{
include('connect.php');
$track = $_POST['track'];
$month = $_POST['months'];
$week = $_POST['weeks'];
$rprice = $_POST['rprice'];
$q = "SELECT track_id FROM tracks WHERE username='$user' AND title = '$track'";
//$r = @mysqli_query ($dbc, $q);
$result = @mysqli_query($dbc, $q);
$row=mysqli_fetch_object($result);
}