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
https://forums.phpfreaks.com/topic/276568-condition-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.