SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issue with Array/Variable -> MySql Field

    I have a slight issue, I'm trying to add and format an array's data into variable $content. I want the $content data to be inserted into a field. My problem is, I keep getting this error "Query was empty". I assumed it must mean $content is empty, but if I print it out it spews out all the information I had given it. Then for debugging purposes, I scrapped the foreach loop and set $content ="Test".. and what do you know.. test has been added to the field. I'm assuming I'm adding data to the $content variable wrong (I'm a novice). Any help would be greatly appreciated. Here is the code snippet:

    Code:
    			foreach($arr as $arras => $p_cat) {
    			$content = "</ul><b>";
    			$content = $content . $arras;
    			$content = $content . "</b><br><ul>";
    			foreach($p_cat as $cat => $link) {
    				
    				$content = $content . "<li>";
    				$content = $content . $link; 
    				$content = $content . "</li>";
    				}
    						}
    						
    		$content = $content . "</ul><br><hr>";
    		//empty the array and up the id number
    		$add_content = mysql_query("UPDATE evoart_article_art SET Links='$content' WHERE id='$b_num'");
    		if(!mysql_query($add_content)) { echo mysql_error(); }
    		echo $content;
    		unset($add_content);
    		
    		
    		unset($arr);
    		$b_num++;

  2. #2
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't absolutely need to send the data already formatted. Is there a way of sending the array into the field?


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
  •