Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Condition help

$
0
0

Hi 

 

I have a code like

 

$movie_name = $arrTitle[0];
	$arrStr = explode(':',$htmlShowTime);
    $release = substr($arrStr[3],0,strlen($arrStr[3])-8);
	$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 

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles