Jump to content
Sign in to follow this  
gongpex

mysql shutdown

Recommended Posts

Hello everyone,

In past I had experience like this :

I have two tables on mysql db and these :

  • shops
  • shop_details

the shops table contains orders from users like :

  • order_id
  • order_number
  • id_item

the shop_details table contains detail orders from users like :

  • order_detail_id
  • order_id
  • item_price

And to insert it I used some php code like this (this code just for mapping not actual code) :

<?php
	if($validation == true){
		/* THIS JUST LOGIC MAPPING NOT ACTUAL CODE */
		$sql = new mysql(host,user,passw,db);
		$query = $sql->query("insert into shop");

		/* LOGIC MAPPING FOR DETAIL */
		if($query){
			$sql->query("insert into shop_detail");
		}
	}
?>

All user's orders were able to inserted on table shop,

but not all user's detail orders were inserted to table shop_detail.

so in other word not all data inserted on table shop_detail due mysql shutdown (maybe i don't know)

Note : I used bot to insert all data for test

Q : how to avoid mysql shutdown if much users do order?

please help me

Thanks

Share this post


Link to post
Share on other sites

The first question is why have you decided that MySQL is shutting down and this is what you need to find the solution for?  Are you using an error log? Are you getting error messages from MySQL? Are you even checking for MySQL errors in your PHP code?

Let me point out that if your'e not showing actual code then I can only comment on what I'm seeing, so I might be solving a different problem than the one you're actually having if you're showing me different code, but obviously that second query is inside an if statement.  Maybe that's the problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×