Jump to content

sagisgirl

Members
  • Posts

    16
  • Joined

  • Last visited

sagisgirl's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yeayh..i just realized that, the variable is empty... ok,thanks for you helping...thanks guys...
  2. suddenly it give me a new error : Query failed: 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 '' at line 1 SELECT * FROM md_tenant WHERE tenantID = why...??
  3. ok i change my code to this.. $query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID; $rs_recTenantID = mysql_query($query_recTenantID) or die ('Query failed: ' . mysql_error(). "<br />\n $query_recTenantID"); while($recTenantID = mysql_fetch_array($rs_recTenantID)) { echo $recTenantID['tenantID']; } then it give an error : Parse error: syntax error, unexpected ')' why..?
  4. sorry jessica..but i didn't understand you... what do you mean by i'm not capturing mySQL errors..?
  5. ok...i did that echo like this.. $query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID; $rs_recTenantID = mysql_query($query_recTenantID); while($recTenantID = mysql_fetch_array($rs_recTenantID)) { echo $recTenantID['tenantID']; } but still i got the same error...
  6. i already create column for tenantID... the error is still the same even after i add echo mysql_error(); here are the 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 '' at line 1 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
  7. is it like this $query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID; $rs_recTenantID = mysql_query($query_recTenantID); echo mysql_error(); $recTenantID = mysql_fetch_array($rs_recTenantID); still got the error.. im new in php..so please do understand me...
  8. thank you..it worked fine now..thanks... but i got another error.: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource here is the code $query_recTenantID = "SELECT * FROM md_tenant WHERE tenantID = ".$tenantID; $rs_recTenantID = mysql_query($query_recTenantID); $recTenantID = mysql_fetch_array($rs_recTenantID); why is that error occur..?
  9. I am getting the following error and can not figure out why: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource so, i made a bit changes to my code here $rs_recTuser = mysql_query($query_recTuser) to this $rs_recTuser = mysql_query($query_recTuser) or die ('Query failed: ' . mysql_error(). "<br />\n$query_recTuser"); then a new error came : Query failed: Unknown column 'tenantID' in 'where clause' SELECT * FROM u_user WHERE tenantID = 9 here is my code: $query_recTuser = "SELECT * FROM u_user WHERE tenantID = ".$tenantID; $rs_recTuser = mysql_query($query_recTuser) or die ('Query failed: ' . mysql_error(). "<br />\n$query_recTuser"); $totalRows_recTuser = mysql_num_rows($rs_recTuser);
  10. ok..i already got it...i left a bracket after VALUES... haha..silly me..thanks to all of you helping me..thank you so much...
  11. Thanks for the reply..ok, i already change it to die('Error:' . mysql_error()); but then i got another error on line 4.. error in your SQL syntax; what does it mean...? is it the query for connect to database is incorrect?
  12. im writting this code again on the another file. then im getting a new error. the error : Warning: mysql_query() expects at least 1 parameter, 0 given in C:\AppServ\www\Epic_SPI\aUser1.php on line 22 Error: <?php #conect to database $conn = mysql_connect("localhost","root","root"); mysql_select_db("spidb",$conn); if ( isset($_POST['save']) && $_POST['save'] != "") { if ($_POST['userName'] || $_POST['password'] ) { $sql = "INSERT INTO u_user (userName,groupCode,userName,password,email,userStatus) VALUES '".$_POST['groupCode']."', '".addslashes(strtoupper($_POST['userName']))."', '".addslashes(strtoupper($_POST['password']))."', '".addslashes(strtoupper($_POST['email']))."', '".addslashes(strtoupper($_POST['userStatus']))."')"; $rslt = mysql_query($sql,$conn); if (!$rslt) { die('Error:'. mysql_query()); } } } $query_recCode = "SELECT * FROM u_usergroup ORDER BY groupDesc"; $rc_recCode = mysql_query($query_recCode); $totalRows_recCode = mysql_num_rows($rc_recCode); ?> <html> <head><title></title></head> <body> <h3 align="center">SPI </h3> <h2 align="center" style="font-style:inherit"> User </h2> <form action="<? $_SERVER['../PHP_SELF']; ?>" method="post"> <span class="alert"><?php echo $alert; ?></span> <?php if($rslt) { ?> <h3 align="center" style="margin:5px; background:#CCCCCC; font-family:'Times New Roman', Times, serif; font-size:18px; border:1px solid #CCC; color:#OOO; border-radius:10px 10px 10px 10px; text-align:center; margin-top:15px; width:500px; margin-left:200px"> Pengguna telah berjaya ditambah!</h3> <? } ?> actually there is not much different with the one that i posted. what is the error means? im new in php.please help me.
  13. jazzman... that query is wrong? what is wrong with that query?
  14. ok.. then i change the code to this.. <?php #Connect to database $conn = mysql_connect("localhost", "root", "root"); mysql_select_db("spidb", $conn); if ( isset($_POST['save']) && $_POST['save'] != "" ) { if ( $_POST['userName'] || $_POST['password'] ) { $sql = "INSERT INTO u_user(userID,groupCode,userName,password,email,userStatus) VALUES ( '".$_POST['groupCode']."', '".addslashes(strtoupper($_POST['userName']))."', '".addslashes(strtoupper($_POST['password']))."', '".addslashes(strtoupper($_POST['email']))."', '".addslashes(strtoupper($_POST['userStatus']))."', )"; $rslt = mysql_query($sql,$conn); if (!$rslt) { die('Error: ' . mysql_error()); } } } $query_recCode = "SELECT * FROM u_usergroup ORDER BY groupDesc"; $rc_recCode = mysql_query($query_recCode); $totalRows_recCode = mysql_num_rows($rc_recCode); ?> <html> <head> <!-- <link rel="stylesheet" href="css/style.css"/>--> <title>..::TAMBAH PENGGUNA::..</title> </head> <body> <h3 align="center"> SISTEM PEMANTAUAN INVENTORI </h3> <h2 align="center" style="font-style:inherit"> Tambah Pengguna </h2> <form action="<? $_SERVER['../PHP_SELF']; ?>" method="post"> <span class="alert"><?php echo $alert; ?></span> <?php if($rslt) { ?> <h3 align="center" style="margin:5px; background:#CCCCCC; font-family:'Times New Roman', Times, serif; font-size:18px; border:1px solid #CCC; color:#OOO; border-radius:10px 10px 10px 10px; text-align:center; margin-top:15px; width:500px; margin-left:200px"> Pengguna telah berjaya ditambah!</h3> <? } ?> but i still got the same error, 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 ')' at line 9 why..? Im so confused right now..please help me solve it.. :'(
  15. i'm sorry, but i still didnt get it..sholud i change this if ( isset($_POST['save']) && ($_POST['save']) != "" ) { if ( ($_POST['userName']) || ($_POST['password']) ) to this if ( isset($_POST['save']) && $_POST['save'] != "" ) { if ( $_POST['userName'] || $_POST['password'] ) i remove some brackets there..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.