简体   繁体   中英

i want to fetch result from database by passing array varaible in php

i am getting array from url but and passing it to database but not getting result but when i am use print_r and copy paste the same data then it give the result. But it is not giving me result when is use varaiable.

$var=$_GET['var'];

 $var=urldecode(base64_decode($var));

$data = explode(',', $var);

//print_r($data);

$reg_id=$data[0];
$email_id=mysqli_real_escape_string($db_event,$data[2]);
$event_id=$data[3];

# this is a function to pass the result and it pass through database in where ...
view_ticket($email_id,$event_id,$reg_id);

but when i do this it gives pe proper output:-

$var=$_GET['var'];
$var=urldecode(base64_decode($var));

$data = explode(',', $var);

//print_r($data);

$reg_id=$data[0];
$email_id=mysqli_real_escape_string($db_event,$data[2]);
$event_id=$data[3];

# this is a function to pass the result and it pass through database in where ...
view_ticket('example@exmaple.com',$event_id,$reg_id);

Try:

$email_id = trim( mysqli_real_escape_string($db_event,$data[2]) );

If you're seeing example@example.com in the print_r() but it's not working, I'm betting there's just some whitespace in there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM