|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Re: Commintg changes to MySql database
Hi all...
Does anyone know the code to commit the changes to MySql data base? You see, I got the code below, and i want to be able to comit the changes to the Dbase itself, not just the array, so does anyone know how to go about that?? Thanx <?php $name = $_POST["name"]; $age = $_POST["age"]; $prov = $_POST["provence"]; mysql_connect ("localhost") or die ("could not connect to Database"); mysql_select_db("biz") or die("could not find database"); $query = "insert into inof(name,age,prov) values ('$name','$age','$prov')"; mysql_query($query) or die(mysql_error()); $result = mysql_query("select * from inof") or die (mysql_error()); while($row=mysql_fetch_array($result)){ if ($row['age']=="41"){ $row['name']="bubba"; echo "\n"; echo $row['name'],"\t",$row['age']. "<br>\n"; } } ?> |
|
#2
|
|||
|
|||
|
Quote:
It looks like you are doing the commit here: $query = "insert into inof(name,age,prov) values ('$name','$age','$prov')"; mysql_query($query) or die(mysql_error()); UNless you are talking about a transactional table, then that's a different story. Can you give more information about the problem you are having? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Re: Commintg changes to MySql database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|