SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Arrow Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

    Hello

    I have error below,
    Code:
    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/onstaged/public_html/admin/edit_parsecall.php on line 31
    PHP code,
    Code:
    <?php
    require_once( "../config/config.inc.php" );
    
    if( isset($_REQUEST[ editid ]) && $_REQUEST[ action ] == "edit" ) {
    	$editid = $_REQUEST[ editid ];
    	//echo $profile_id;
    }
    
    /*
    date_posted expiration gender ethnicity country state city zipcode agerange categories uniontext rate 
    listeddate email link_partial link_complete
    title description email description
    */
    
    if(isset($_POST['updateparse']))
    {
    	#$query="update `tbl_parsing_call` set parse_title='{$_POST[fname]}',parse_email='{$_POST[lname]}', parse_emailcontent='{$_POST[adname]}',parse_message='{$_POST[ademail]}' where id='{$editid}'";
    	$query="update `castingcall` set title='{$_POST[title]}', email='{$_POST[email]}', description='{$_POST[description]}' where id='{$editid}'";	
    	$DB->Execute($query);
    		
    	if(!$DB->Execute($query))	Redirect( "Updation Failed.", "viewparsingcalls.php" );
    	else Redirect( "Parsing Calls modified Successfully.", "viewparsingcalls.php" );
    
    } else {
    	#$query_profile = "select  id,parse_title,parse_email,parse_emailcontent,parse_message from `tbl_parsing_call` where id='{$editid}'";
    	#$query_profile = "select castingid, title, email, description from `castingcall` where id='{$editid}'";
    	#$profile_details = $DB->getArray( $query_profile );
    
    	$sql = "SELECT castingid, title, email, description FROM castingcall where id='{$editid}'";	
    	$result = mysql_query($sql);
    	while ($row = mysql_fetch_assoc($result)) {
    		echo $row["castingid"];
    		echo "<br>";
    		echo $row["title"];
    		echo "<br>";		
    		echo $row["email"];
    		echo "<br>";		
    		echo $row["description"];
    	}
    	
    	echo "<pre>";
    	print_r($array_tmp);
    	echo "<pre>";
    	
    	
    	#$smarty->assign('results', mysql_fetch_array($result));
    	
    	
    	$adminsmarty-> assign("delete_msg",$saved_delete);
    	$adminsmarty-> assign("title", "Edit Parsing Calls" );
    	#$adminsmarty-> assign("profile_details", $profile_details );	
    	$adminsmarty-> display('modules/admin/edit_parsecall.tpl');
    }
    
    ?>

    Anyone would like to help me.

    Thanks in advance.

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    it means you query has failed somewhere. Change the query line to:
    PHP Code:
    $result mysql_query($sql) or die(mysql_error() . ' SQL: '$sql); 
    and see what it says.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    IIRC this means your sql statement was badly formed.

    Was that you or was it PHP wot did it?

    echo $query onto the page, take a good look at it. See nothing wrong with it? So copy the text, paste it into your database and see if it brings back the results you expected.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •