开发者

How would i output a message that says "values inserted to table"? [duplicate]

开发者 https://www.devze.com 2023-02-01 21:09 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: How would I add a message that says “$user_id Deleted” or “$user_id not found?”
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

How would I add a message that says “$user_id Deleted” or “$user_id not found?”

开发者_如何学Go
<?php
  error_reporting(0);
  $con=mysql_connect("localhost","root","");

  if (!$con) {
    die('could not connect:'.mysql_error());
  }

  mysql_select_db("final?orgdocs",$con);

  $org_name = $_POST["org_name"];
  $org_type = $_POST["org_type"];
  $org_code = $_POST["org_code"];
  $description = $_POST["description"];

  $stmt = "INSERT INTO organization
           VALUES('".$org_name."','".$org_type."','".$org_code."','".$description."')";
  $result = mysql_query("SELECT * FROM organization WHERE org_name = '$org_name' ");

  echo '<TABLE BORDER = "1">';
  $result1 = $result;

  while ($row = mysql_fetch_array($result1)){
    echo '<TR>'.'<TD>'.'Organization Name'.'</TD>'.'<TD>'.'Organization Type'.'</TD>'.'<TD>'.'Organization Code'.'</TD>'.'<TD>'.'Description'.'</TD>'.'<TD>'.'Constitution'.'</TD>';
    echo '</TR>';
    echo '<TR>'.'<TD>'.$row['org_name'].'</TD>'.'<TD>'.$row['org_type'].'</TD>';
    echo '<TD>'.$row['org_code'].'</TD>'.'<TD>'.$row['description'].'</TD>'.'<TD>';
    echo '</TR>';
  }    
  echo '</TABLE>';
?>


    $count = mysql_affected_rows();
    echo "$count values inserted to table”;


Shortest answer : echo 'values inserted to table';

0

精彩评论

暂无评论...
验证码 换一张
取 消