Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'query.php';
- date_default_timezone_set('Africa/Cairo');
- $searchKey=$_POST["searchItem"];
- $result= array();
- $sql = mysql_query("SELECT * FROM Jobbya where category like '$searchKey'");
- if($sql === FALSE)
- {
- die(mysql_error());
- }
- while ($row = mysql_fetch_array($sql))
- {
- $jobId=$row["jobId"];
- $jobName=$row["jobName"];
- $description=$row["description"];
- $category=$row["category"];
- $sql1 = mysql_query("SELECT imageUrl FROM pictures where jobId='$jobId'");
- $image="";
- $counter=0;
- while ($row = mysql_fetch_array($sql1))
- {
- $image=row["imageUrl"];
- $counter+=1;
- if(counter==1)
- break;
- }
- $sql2 = mysql_query("SELECT videoUrl FROM videos where jobId='$jobId'");
- $video="";
- $counter=0;
- while ($row = mysql_fetch_array($sql2))
- {
- $video=row["videoUrl"];
- $counter+=1;
- if(counter==1)
- break;
- }
- $result1[] = array
- (
- 'jobId' => $jobid,
- 'jobName'=> $jobName,
- 'description'=>$description,
- 'category'=>$category,
- 'image'=>$image,
- 'video'=>$video
- );
- array_push($result,$result1);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement