Jump to content

rrahulr

New Members
  • Posts

    5
  • Joined

  • Last visited

rrahulr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well, even after i stopped suppressing the errors, i still remain clueless and guessing on what the issue might be.There is no error messages that come up on the screen even after i checked using mysql_query($sql) and die(mysql_error()).
  2. The primary key which is the id is set to auto increment. Here's the code... if($_POST['formSubmit'] == "Submit") { //appending the date to store in the database. $entry_date_array = array($_REQUEST["year"],$_REQUEST["month"],$_REQUEST["day"]); $entry_date = implode('-', $entry_date_array); echo "$entry_date"; //appending aggr nr and fetching the id from the database. $aggr_nr = $_REQUEST['list_nr_01'].$_REQUEST['list_nr_02'].$_REQUEST['list_nr_03']; $sql="SELECT v.id FROM aggregatenumber AS v WHERE v.aggr_nr = '".$aggr_nr."'";//missing Quotes $aggr_id = @mysql_query($sql); $result = @mysql_fetch_array($aggr_id); $test= $result['id']; echo "$test"; $sql_einl_sp = "INSERT INTO search_parts(entry_date,aggr_nr)values('".$entry_date."','".$test."')"; $result_einl_sp = @mysql_query($sql_einl_sp); if ($result_einl_sp == false) die(" Could not execute statement ".$sql_einl_sp); @mysql_close(); } Html Code ----- <body> <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post"> <h>Save Information</h> <input type="submit" name="formSubmit" value="Submit" /> <input type="submit" name="btncancel" value="Cancel"/> </form> </body>
  3. thanks a lot for your help.I figured it out where the mistake was..as jessica suggested $_get does not store the variables.But now I'm able to retrieve the id values from the database and when i try to insert, they go into the columns as "0".A bigger problem
  4. Hello, I'm trying to concatenate a number split in 3 different text boxes and then compare it against the id value stored in the database and store in a variable so that the corresponding id number can be used in an insert statement, but i don't where i seem to go wrong.If any one could help me with this, it would be really helpful. Thanks. aggr_nr = $_REQUEST['list_nr_01'].$_REQUEST['list_nr_02'].$_REQUEST['list_nr_03']; $sql="SELECT v.id FROM vers_einl_aggregatenumber AS v WHERE v.aggr_nr = '".$aggr_nr."'";//missing Quotes $aggr_id = @mysql_query($sql); $result = @mysql_fetch_array($aggr_id); $test= $_get[$result['id']];
×
×
  • 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.