mus
Members-
Posts
23 -
Joined
-
Last visited
Never
Everything posted by mus
-
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
her [attachment deleted by admin] -
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
her is me structore [attachment deleted by admin] -
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
here is my structore [attachment deleted by admin] -
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
i now my hostname and my database hostname = 10.127.01.13 database = polish -
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
i have try this code but it not work. i dont why went i try in my location server this code work fine, when i finished to update in database they will jump back to my polish.php but went i upload to my hostmaster server they will not jump back to polish.php i dont why??? can some one help me thanks u -
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
<? $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; $username="User"; // Mysql username $password="PASS"; // Mysql password mysql_connect ("HOST NAME","$username", "$password") or die ("cannot connect"); mysql_select_db("DATABASE NAME") or die ("cannot select DB"); $query="INSERT INTO opi(id, raekke, modelnr, navn, priser, display, bruger, salg, usedup, instock, totaltstock) VALUES ('NULL', '".$raekke."', '".$modelnr."','".$navn."', '".$priser."', '".$display."','".$bruger."','".$salg."','".$usedup."','".$instock."','".$totaltstock."')"; $result = mysql_query($query) or die ('error updating databasen'); mysql_close($result); if ($result ) { header("location:polish.php"); } ?> -
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
<? $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; $username="usename"; // Mysql username $password="password"; // Mysql password mysql_connect ("Host name","$username", "$password") or die ("cannot connect"); mysql_select_db("polish") or die ("cannot select DB"); $query="INSERT INTO opi(id, raekke, modelnr, navn, priser, display, bruger, salg, usedup, instock, totaltstock) VALUES ('NULL', '".$raekke."', '".$modelnr."','".$navn."', '".$priser."', '".$display."','".$bruger."','".$salg."','".$usedup."','".$instock."','".$totaltstock."')"; $result = mysql_query($query) or die ('error updating databasen'); mysql_close($result); if ($result ) { header("location:polish.php"); ?> } -
thanks u very much WebStyles and voip03
-
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
is not work i have try to changes this code $result = mysql_query($query) or die ('error updating databasen'); mysql_close($result); if ($result ) { header("location:polish.php"); } ?> -
thanks you this code work good but if i want to have small nummer first.examples 1, ,2, 3,4 not 4, 3, 2, 1, thanks
-
help with header("location:polish.php"); i have problem
mus replied to mus's topic in PHP Coding Help
i dont but i can update with my database, and when im finished to update, when i click to polish.php can i see they have put to in my database but i dont why they not header to polish.php they will be in this site -
yes but code is not work please help me thanks but thanks for help voip03
-
hi some people can help me i dont why im put this to my Hostmaster www.one.com but my if ($query) { header("[color=red]location:polish.php[/color]"); } is not work they will not header to my polish.php when im finished with my update in my database <? $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; $username="usename"; // Mysql username $password="password"; // Mysql password mysql_connect ("hostt","$username", "$password") or die ("cannot connect"); mysql_select_db("database") or die ("cannot select DB"); $query="INSERT INTO opi(id, raekke, modelnr, navn, priser, display, bruger, salg, usedup, instock, totaltstock) VALUES ('NULL', '".$raekke."', '".$modelnr."','".$navn."', '".$priser."', '".$display."','".$bruger."','".$salg."','".$usedup."','".$instock."','".$totaltstock."')"; mysql_query($query) or die ('error updating databasen'); mysql_close($query); if ($query) { header("location:polish.php"); } ?> i want to when im finished they will header to my polish.php thanks
-
hi IrOnMaSk <?php$result = mysql_query("SELECT * FROM opi order by row desc");//error message can go here after ; i now this code will be error but i dont now how i can make this can some people help me
-
hi some people can help me im new in php. i want to sorting nummer in my table nam ( row) $result = mysql_query("SELECT * FROM opi ordre by row desc") have i done this right code
-
can you tell me why 2 rows of the same name appears in the database instead of one 1:form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="util-functions.js"></script> <script type="text/javascript" src="clear-default-text.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>update</title> </head> <body> <table width="1280px" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="1280px" height="40px" valign="top"> <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <form action="updatedb.php" method="post"> <td width="82" height="100%" valign="top"><input name="raekke" type="text" size="7" value="Row:" class="cleardefault"/></td> <td width="110" height="100%" valign="top"><input name="modelnr" type="text" size="12" value="Model Nr:" class="cleardefault" /> </td> <td width="293" height="100%" valign="top"><input name="navn" type="text" size="40" value="Name:" class="cleardefault" /></td> <td width="93" height="100%" valign="top"><input name="priser" type="text" size="10" value="Price:" class="cleardefault" /></td> <td width="123" height="100%" valign="top"><input name="display" type="text" size="12" value="Display:" class="cleardefault" /></td> <td width="104" height="100%" valign="top"><input name="bruger" type="text" size="10" value="Using:" class="cleardefault" /></td> <td width="104" height="100%" valign="top"><input name="salg" type="text" size="10" value="Sall:" class="cleardefault" /></td> <td width="101" height="100%" valign="top"><input name="usedup" type="text" size="10" value="Use Up:" class="cleardefault"/></td> <td width="107" height="100%" valign="top"><input name="instock" type="text" size="12" value="In Stock:" class="cleardefault" /></td> <td width="128" height="100%" valign="top"><input name="totaltstock" type="text" size="15" value="Totalt Stock:" class="cleardefault"/></td> <td width="139" height="100%" valign="top"><input type="submit" value="Update Polish"/></td> </form> </tr> </table> </td> </tr> <tr> <td width="1280px" height="100%" valign="top"> </table> </td> </tr> </table> </body> </html> 2:select <? $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; $username=""; // Mysql username $password=""; // Mysql password mysql_connect ("localhost", "root","$username", "$password") or die ("cannot connect"); mysql_select_db("polish") or die ("cannot select DB"); $query="INSERT INTO `polish`.`opi`(id, raekke, modelnr, navn, priser, display, bruger, salg, usedup, instock, totaltstock) VALUES ('NULL', '".$raekke."', '".$modelnr."','".$navn."', '".$priser."', '".$display."','".$bruger."','".$salg."','".$usedup."','".$instock."','".$totaltstock."')"; mysql_query($query) or die ('error updating databasen'); $result = mysql_query($query); mysql_close($query); if ($result) { header("location:polish.php"); } ?> [attachment deleted by admin]
-
thank very much mikosiko is working now thanks
-
i have try to change $query = "UPDATE `polish`.`update` SET Database Error: UPDATE command denied to user ''@'localhost' for table 'update'No records updated $query = "UPDATE `update` SET Database Error: No database selectedNo records updated update is my database table name, so is best i change them.but my code is not problem? thanks
-
hi im new with php some people can help me please i have this error from database som like 1:update form html> <head> <title>change database</title> </head> <body bgcolor="white"> <form method="POST" action="sysdocupdate.php"> <table> <col span="1" align="right"> <tr> <td><font color="blue">ID to Update:</font></td> <td><input type="text" name="id" size=100></td> </tr> <tr> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> 2:sysdocupdate.php <?php foreach($_POST as $varname => $value) $_POST[$varname]=$value; $db1 = mysql_connect ("localhost", "root","", "") or die ("cannot connect"); mysql_select_db("polish") or die ("cannot select DB"); $result = mysql_query("SELECT * FROM `polish`.`update` where id = \"".$_POST["id"]. "\""); $row=mysql_fetch_array($result); $_POST = array(); $_POST["raekke"]=$row["raekke"]; $_POST["modelnr"]=$row["modelnr"]; $_POST["navn"]=$row["navn"]; $_POST["priser"]=$row["priser"]; $_POST["display"]=$row["display"]; $_POST["bruger"]=$row["bruger"]; $_POST["salg"]=$row["salg"]; $_POST["usedup"]=$row["usedup"]; $_POST["instock"]=$row["instock"]; $_POST["totaltstock"]=$row["totaltstock"]; $_POST["id"]=$row["id"]; mysql_close($db1); ?> <html> <head> <title>SystemsDoc Update</title> </head> <body bgcolor="white"> <form method="post" action="postupdate.php"> <table> <col span="1" align="right"> <tr> <td><font color="blue">Row:</font></td> <td><input type="text" name="raekke" value="<? echo $_POST["raekke"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Model_Nr:</font></td> <td><input type="text" name="modelnr" value="<? echo $_POST["modelnr"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Name:</font></td> <td><input type="text" name="navn" value="<? echo $_POST["navn"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">price:</font></td> <td><input type="text" name="priser" value="<? echo $_POST["priser"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">display</font></td> <td><input type="text" name="display" value="<? echo $_POST["display"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Using:</font></td> <td><input type="text" name="bruger" value="<? echo $_POST["bruger"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Sall:</font></td> <td><input type="text" name="salg" value="<? echo $_POST["salg"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Used Up:</font></td> <td><input type="text" name="usedup" value="<? echo $_POST["usedup"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">In Stock:</font></td> <td><input type="text" name="instock" value="<? echo $_POST["instock"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Totalt Stock:</font></td> <td><input type="text" name="totaltstock" value="<? echo $_POST["totaltstock"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">ID:</font></td> <td><input type="text" name="id" value="<? echo $_POST["id"]; ?>" size=100></td> </tr> <tr> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> 3:Postupdated <?php // Save form values to $formVars array foreach($_POST as $varname => $value) $_POST[$varname]=$value; $id = $_POST['id']; $raekke = $_POST['raekke']; $modelnr = $_POST['modelnr']; $navn = $_POST['navn']; $priser = $_POST['priser']; $display = $_POST['display']; $bruger = $_POST['bruger']; $salg = $_POST['salg']; $usedup = $_POST['usedup']; $instock = $_POST['instock']; $totaltstock = $_POST['totaltstock']; // Include database config file // Connect to mysql and select database $db1 = mysql_connect("localhost", "host", ""); mysql_select_db("polish"); // Run query, check for errors $query = "UPDATE update SET raekke = '".$_POST['raekke']."', modelnr = '".$_POST['modelnr']."', navn = '".$_POST['navn']."', priser = '".$_POST['priser']."', display= '".$_POST['display']."', bruger='".$_POST['bruger']."', salg= '".$_POST['salg']."', usedup='".$_POST['usedup']."', instock = '".$_POST['instock']."', totaltstock='".$_POST['totaltstock']."' WHERE id = '".$_POST['id']."'"; if (mysql_query($query) == FALSE) { echo "Database Error: " . mysql_error(); } // Check for affected records if (mysql_affected_rows() > 0) { echo "Record updated<br><a href=\"sysdocupdate.php\">click here</a> to update another record<br>"; } else { echo "No records updated"; } // Close database connection mysql_close($db1); ?> </body> </html> i get this error from NR:3 Postupdated Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update SET raekke = '3', modelnr = '0', navn = 'hello', priser = '0', display= '' at line 1No records updated some people can help me thanks very much
-
im not sure im understand what you think but i will trying but thank u very much to help me
-
thanks WebStyles foreach($_POST as $varname => $value) is work now but im dont understand with if(!isset($_POST) || empty($_POST){echo '<br>Nothing was posted from form.<br>';} can u show me where i put this code in toim sorry but im not undestand sorry please help me i have try this one but i dont understande where i will put you code <?php foreach($_POST as $varname => $value) $_POST[$varname]=$value; $db1 = mysql_connect("localhost", "host", ""); mysql_select_db("polish"); $query="SELECT * FROM update WHERE id = \"".$_POST["id"]."\""; $result=mysql_query($query); $row=mysql_fetch_array($result); $_POST = array(); $_POST["raekke"]=$row["raekke"]; $_POST["modelnr"]=$row["modelnr"]; $_POST["navn"]=$row["navn"]; $_POST["priser"]=$row["priser"]; $_POST["display"]=$row["display"]; $_POST["bruger"]=$row["bruger"]; $_POST["salg"]=$row["salg"]; $_POST["usedup"]=$row["usedup"]; $$_POST["instock"]=$row["instock"]; $_POST["sysversion"]=$row["sysversion"]; $_POST["totaltstock"]=$row["totaltstock"]; $_POST["id"]=$row["id"]; mysql_close($db1); ?> <html> <head> <title>SystemsDoc Update</title> </head> <body bgcolor="white"> <form method="post" action="postupdate.php"> <table> <col span="1" align="right"> <tr> <td><font color="blue">Row:</font></td> <td><input type="text" name="raekke" value[color=red]="<? echo $formVars["raekke"]; ?>" [/color] size=100></td> </tr> <tr> <td><font color="blue">Model_Nr:</font></td> <td><input type="text" name="modelnr" value="<? echo $formVars["modelnr"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Name:</font></td> <td><input type="text" name="navn" value="<? echo $formVars["navn"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">price:</font></td> <td><input type="text" name="priser" value="<? echo $formVars["priser"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">display</font></td> <td><input type="text" name="display" value="<? echo $formVars["display"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Using:</font></td> <td><input type="text" name="bruger" value="<? echo $formVars["bruger"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Sall:</font></td> <td><input type="text" name="salg" value="<? echo $formVars["salg"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Used Up:</font></td> <td><input type="text" name="usedup" value="<? echo $formVars["usedup"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">In Stock:</font></td> <td><input type="text" name="instock" value="<? echo $formVars["instock"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Totalt Stock:</font></td> <td><input type="text" name="totaltstock" value="<? echo $formVars["totaltstock"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">ID:</font></td> <td><input type="text" name="ID" value="<? echo $formVars["ID"]; ?>" size=100></td> </tr> <tr> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> Notice: Undefined index: id in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 10 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 12
-
HI im newbie with PHP i have finde code in this website http://www.netadmintools.com/art332.html to make Update in Mysql database. want i test them i have this problem Notice: Undefined variable: HTTP_POST_VARS in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 3 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 3 Notice: Undefined variable: formVars in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 10 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 12 1: change form <html> <head> <title>change database</title> </head> <body bgcolor="white"> <form method="POST" action="sysdocupdate.php"> <table> <col span="1" align="right"> <tr> <td><font color="blue">UID to Update:</font></td> <td><input type="text" name="if" size=100></td> </tr> <tr> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> 2:sysdocupdate.php <?php foreach($HTTP_POST_VARS as $varname => $value) { $formVars[$varname]=$value; } $db1 = mysql_connect("localhost", "host", ""); mysql_select_db("polish"); $query="SELECT * FROM update WHERE id = \"".$formVars["id"]."\""; $result=mysql_query($query); $row=mysql_fetch_array($result); $formVars = array(); $formVars["raekke"]=$row["raekke"]; $formVars["modelnr"]=$row["modelnr"]; $formVars["navn"]=$row["navn"]; $formVars["priser"]=$row["priser"]; $formVars["display"]=$row["display"]; $formVars["bruger"]=$row["bruger"]; $formVars["salg"]=$row["salg"]; $formVars["usedup"]=$row["usedup"]; $formVars["instock"]=$row["instock"]; $formVars["sysversion"]=$row["sysversion"]; $formVars["totaltstock"]=$row["totaltstock"]; $formVars["id"]=$row["id"]; mysql_close($db1); ?> <html> <head> <title>SystemsDoc Update</title> </head> <body bgcolor="white"> <form method="post" action="postupdate.php"> <table> <col span="1" align="right"> <tr> <td><font color="blue">Row:</font></td> <td><input type="text" name="raekke" value="<? echo $formVars["raekke"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Model_Nr:</font></td> <td><input type="text" name="modelnr" value="<? echo $formVars["modelnr"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Name:</font></td> <td><input type="text" name="navn" value="<? echo $formVars["navn"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">price:</font></td> <td><input type="text" name="priser" value="<? echo $formVars["priser"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">display</font></td> <td><input type="text" name="display" value="<? echo $formVars["display"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Using:</font></td> <td><input type="text" name="bruger" value="<? echo $formVars["bruger"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Sall:</font></td> <td><input type="text" name="salg" value="<? echo $formVars["salg"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Used Up:</font></td> <td><input type="text" name="usedup" value="<? echo $formVars["usedup"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">In Stock:</font></td> <td><input type="text" name="instock" value="<? echo $formVars["instock"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">Totalt Stock:</font></td> <td><input type="text" name="totaltstock" value="<? echo $formVars["totaltstock"]; ?>" size=100></td> </tr> <tr> <td><font color="blue">ID:</font></td> <td><input type="text" name="ID" value="<? echo $formVars["ID"]; ?>" size=100></td> </tr> <tr> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> 3:postupdate.php <?php // Save form values to $formVars array foreach($HTTP_POST_VARS as $varname => $value) { $formVars[$varname]=$value; } // Include database config file // Connect to mysql and select database $db1 = mysql_connect("localhost", "host", ""); mysql_select_db("polish"); // Run query, check for errors $query = "UPDATE update SET raekke = '{$formVars["raekke"]}',modelnr = '{$formVars["modelnr"]},navn = '{$formVars["navn"]},priser = '{$formVars["priser"]},display = '{$formVars["display"]},bruger = '{$formVars["bruger"]},salg = '{$formVars["salg"]},usedup = '{$formVars["usedup"]},instock = '{$formVars["instock"]}totaltstock = '{$formVars["totaltstock"]} WHERE id = '{$formVars["id"]}'"; if (mysql_query($query) == FALSE) { echo "Database Error: " . mysql_error(); } // Check for affected records if (mysql_affected_rows() > 0) { echo "Record updated<br><a href=\"sysdocupdate.php\">click here</a> to update another record<br>"; } else { echo "No records updated"; } // Close database connection mysql_close($db1); ?> </body> </html> and i have this problem went i try them Notice: Undefined variable: HTTP_POST_VARS in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 3 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 3 Notice: Undefined variable: formVars in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 10 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\polish\test\sysdocupdate.php on line 12 please help me thanks [attachment deleted by admin]