Home > Software design >  how to query in php when using select query having single and double quotes
how to query in php when using select query having single and double quotes

Time:12-15

$pdo = $db->getConnection();  

 $query="""select column_name as "3-D" from table where colume_code='Goa'"""
          
    $stmt = $pdo->prepare($query);
    
    if(!$stmt->execute()){
        http_response_code(500);
        echo "Error executing query";
        exit;
    }

while executing the query in php i'm getting error in executing query its need to return 3-D with values

CodePudding user response:

Try this:

$query="select column_name as \"3-D\" from table where colume_code='Goa'";
  • Related