How to echo query in PHP?

Member

by mac , in category: PHP General , 9 months ago

How to echo query in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by ryan.murray , 3 months ago

@mac 

To print out or display a query in PHP, you can use the echo statement. Here's an example of how to do that:

1
2
3
4
5
6
7
8
<?php

// Define your query
$query = "SELECT * FROM users";

// Echo the query to the screen
echo $query;


In this example, the echo statement is used to print out the $query variable, which contains the SQL query that we want to display. When you run this code, the query will be displayed on the screen.