Jump to content

Condition help


ydeonia

Recommended Posts

Hi 

 

I have a code like

 

$movie_name = $arrTitle[0];
	$arrStr = explode(':',$htmlShowTime);
    $release = substr($arrStr[3],0,strlen($arrStr[3])-;
	$director = substr($arrStr[5],0,strlen($arrStr[5])-11);
	
	$del_movie = "delete from jos_movie";
	mysql_query($del_movie);
	
	$del_cinema = "delete from jos_cinema";
	mysql_query($del_cinema);
	
	
	$sql = "insert into jos_movie(movie_name,language,cast,movie_release,director)values('$movie_name','null','$cast','$release','$director')";
	
	
	mysql_query($sql);
	
	$sqlCount = 'select max(id) from jos_movie';
	$data = mysql_query($sqlCount);
	$result = mysql_fetch_array($data);
	$id = $result[0];

	//$id = mysql_insert_id();
	
	
		// find all span tags with class=gb1
	foreach($html->find('div.moviTmngBox') as $e){
    	$tagTitle =  $e->find('a',0);
		$tagTime  = $e->find('div.moviTimes',0);
		$name = $tagTitle->title;
		$time = $tagTime->innertext;
		//echo $tagTime->innertext.'<br/>';
		$sql = "insert into jos_cinema(cinema_name,show_time,movie_id,logitude,latitude)values('$name','$time',$id,'32.7300','74.8700')";
		//echo $sql.'<br/>';
		mysql_query($sql);
		//$arrTem = array($tagTitle->title,$tagTime->innertext);
		
	}
	
}//end rss feed loop

 

For now line 

 

$sql = "insert into jos_cinema(cinema_name,show_time,movie_id,logitude,latitude)values('$name','$time',$id,'32.7300','74.8700')"

 

I am using hard code values for longitude and latitude . This loop runs for 4 times since  there are 4 cinemas. Can you please help me making a condition insert longitude and latitude on the basis of $name (cinema_name) . The longitude and latitude for all 4 cinemas are with me.

 

thanks 

 

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.