I am trying to update several rows in the database using mysql statement. My code is as follows.


 $query = mysql_connect("localhost","root","toor");
 $result=mysql_query("Select * from ticket_reservation WHERE validate_status='No'") or die(mysql_error());
  echo "<tr><td><input type='checkbox' id='name'  name='name[]' value=".$row['id']."</td><td>".$row['userid']."</td><td>".$row['busid']."</td><td>".$row['numberofseats']."</td></tr>";

echo"<tr><td><input type='submit' name='submit' Value='Validate Tickets'></td></tr>";

        $qry = "UPDATE ticket_reservation SET validate_status='Yes' WHERE id IN (".implode(',', $_POST['name']).")";
       // echo $qry; // For checking the generated sql statement; can be removed


My code is not working....

You have not added the code for inserting salutation ID. You may use string concatenation like:


Use join to get the values ffrom both tables at the same time.

After all this to fetch info from database,

You may try using a drop down list for company names.
Make a single form for all seven companies.
Make a login form for all useraccounts...
Now create a new database and connect to it (depends which database you are using)
Create tables for user accounts and company information saparately.
Use "insert into" satatements and "POST" method to fetch the information to database.
Make saparate pages to show the Company reports information.
Now require login to access company information and profile.
use require


like statement to ensure that user may not access pages without


After all this to fetch info from database, 
Use SQL join table statements to join login credentials and company information and reports. 
I think that would be fine If you use OOP based structure rather than procedural one.

thankyou dear it worked for me...

I want to deploy a database application in C#. I should write a script for creating a database and its tables.
The script should work only at install time and setup the database automatically. Or tell me if there is another better way to do that.
Actually I wanted to deploy this application on another PC. but connection string and login permissions to the database are causing problem.
What I have tried is:

  1. Created a database using SQL management studio.
  2. copied database file to Client PC.
    But that did not work.
    Then I tried adding a new database project to my solution. That also did not work.
    The application runs fine on my own PC where I have developed this project.


I am trying to store a value from a selected row from one table into another. My code is as follows.

 string CustomerID = textBox1.Text;

                SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString);
                SqlCommand myCommand = new SqlCommand("Select CustomerID, Name from TableCustomer WHERE (CustomerID like '" + CustomerID+ "')", con1);

                SqlDataReader rdr = myCommand.ExecuteReader();

                    while (rdr.Read())
                        string Name = rdr["Name"].ToString();

                SqlCommand cmd = new SqlCommand(@"insert into finalTable (AccountNumber, CustomerName) VALUES
                (@CustomerID,   @Name )", con);


My code is not working properly. All is I want to insert Name and ID of customer in Name field of finalTable. What is wrong with this code?

that is the right way
using namespace std;
after iostream statement and it will surely compile....