use a webhosting company with php4 and mysql
I use dreamweaver MX
90% of the time all is ok but sometimes customers get a message :too many connections"
Is there something fundamentally wrong with my code?
The syntax is fine as this works, just wondered if the errors due to poorly written code by dreamweaver?
It is as follows
dreamweaver creates a connection file that is called from the page and it uses the mysql_pconnect funtion
on my page I have
mysql_select_db($database_inventory, $inventory);
$query_Recordset1 = "SELECT * FROM entries";
$Recordset1 = mysql_query($query_Recordset1, $inventory) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
mysql_select_db($database_inventory, $inventory);
$query_Recordset2 = "SELECT * FROM store";
$Recordset2 = mysql_query($query_Recordset2, $leamingtontri) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
BUNCH OF HTML
THEN to write to the database
mysql_select_db($database_inventory, $inventory);
$query = "INSERT INTO customer VALUES ('', '$date', '$rvarevent','$rvarfname', '$rvarlname', '$rvarmember','$rvaremail', '($rvarareacode)-$rvarphone', '$rvarstreet','$rvarcity', '$rvarprov','$rvartransactionfee', '$rvarsubtotal','$charge_total','$response_order_id','$cust_id')";
$result=mysql_query($query) ;
mysql_select_db($database_inventory, $inventory);
$query = "INSERT INTO stock VALUES ('', '$date', '$item','$name, '$id)";
$result=mysql_query($query) ;
then a bunch of html and at the bottom I have
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);