Hi,

Tuesday, September 10, 2002, 1:41:23 PM, you wrote:
PH> Hello everyone..tryin to run this qry against a mysql db, but after it runs, 
PH> it doesn't assign anything to the variables as it should. If i return all 
PH> rows, and spit out each record in the result in an array, i have the same 
PH> problem, but have 24 'blank' records instead of 1. Any ideas? Thanks for any 
PH> input. I tried doing a print mysql_error(); after the query and the result, 
PH> but it doesn't return anything. Column names, db name, and WHERE clause are 
PH> all spelled correctly, and the $currenttaskid is populated (as 1)...

PH> $detailqry = "SELECT id, parentitemid, itemtypeid, itemstatusid, 
PH> itemlevelid, shortdescription,
PH> createdby_memberid, assignedto_memberid, completedby_memberid, createddate, 
PH> assigneddate,
PH> estcompletiondate, completeddate, projectid, lastuserid, lastdate FROM item 
PH> WHERE id=$currenttaskid";

PH> $result = mysql_query($detailqry) or die("Failed finding task details");

PH>        $taskid = $result["id"];
PH>        $taskparentitemid = $result["parentitemid"];
PH>        $taskitemtypeid = $result["itemtypeid"];
PH>        $taskitemstatusid = $result["itemstatusid"];
PH>        $taskitemlevelid = $result["itemlevelid"];
PH>        $taskshortdescription = $result["shortdescription"];
PH>        $createdbyid = $result["createdby_memberid"];
PH>        $assignedtoid = $result["assignedto_memberid"];
PH>        $completedbyid = $result["completedby_memberid"];
PH>        $taskcreateddate = $result["createddate"];
PH>        $taskassigneddate = $result["assigneddate"];
PH>        $taskestcompletiondate = $result["estcompletiondate"];
PH>        $taskcompleteddate = $result["completeddate"];
PH>        $taskprojectid = $result["projectid"];
PH>        $tasklastuserid = $result["lastuserid"];
PH>        $tasklastdate = $result["lastdate"];

PH> mysql_free_result($result);


PH> -IrishBiotch
PH> [EMAIL PROTECTED]


PH> _________________________________________________________________
PH> Join the world’s largest e-mail service with MSN Hotmail. 
PH> http://www.hotmail.com

You need to do this:

if($result = mysql_query($detailqry)){
           $row = mysq_fetch_array($result);
}
else{
     echo "Error: Failed finding task details ".mysql_error();
}

All your fields will be in the array $row. $result is just an
identifier not the actual result set.

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to