Jump to content

echohing a success to a SQL query


webguync

Recommended Posts

I want to add an echo to this Query if successfull. Please assist.

 

<?
session_start();
//DELETE QUERY TO SELECT RECORD TO DELETE BASED ON LOGIN INFO.
$query_delete = "DELETE FROM log_March2010 WHERE user_id = $user_id AND roster_March2010.user_id = $user_id";
//echo $query; //for debugging test
$result_delete = mysql_query($query_delete) or die(mysql_error());
?>

 

something like echo ("Deletion Successful");

 

would it just go below $result_delete or do I need to add an if/then?

Link to comment
https://forums.phpfreaks.com/topic/198564-echohing-a-success-to-a-sql-query/
Share on other sites

thanks, I'll try that out Maq. For my benefit what is the advantage of using <?php  over shorthand?

 

The main reason is if you ever want to port your code elsewhere and that server has short_open_tag disabled, your code will not work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.