Jump to content

fail experiment (mysql fetch array...)


BluwAngel

Recommended Posts

Warning: mysql_fetch_array() expects parameter 1 to be resource, string given...

 

 

im tryin to put class inside code if $dayNumber and $dan are equal

 

i tried few ways but all are complicated since i have to call some functions this end up as "simple" solution but i dont know where did i get wrong PS that should be possible?

 

else {
                  echo "<td width='40'";
			  $moj_id = $_SESSION['id'];
			  $query_event = mysql_query("SELECT * FROM events WHERE id_user='$moj_id' GROUP BY 'event_date'") ;
			  $test = mysql_fetch_array('$query_event');
			  $date_event = $test['event_date'];
			  sscanf($date_event, "%d-%d-%d", $godina, $mjesec, $dan);
			  if ($dan==$dayNumber && $mjesec==$month && godina==$year)
			  {

				  echo " class='radni'";
			  }
			  
			  
			  echo"><a href='day_info.php?dan=",$dayNumber,"&mj=",$month,"&gd=",$year,"'>" . $dayNumber . " </a></td>\n";
                  $dayNumber++;                           
              }

Link to comment
Share on other sites

it did solve my problem, but it still gets only 1 result - its calendar, it generate numbers(days) ok, but somehow it fails to put that class on field i want to

 

on event_date i have dates 28.03.2012 30.03.2012 and it only put at 30.03.2012.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.