Jump to content

chintansshah

Members
  • Posts

    244
  • Joined

  • Last visited

Posts posted by chintansshah

  1. Hello,

    during dynamic create of form value, in for loop write a below code

     

    <input type="hidden" name="dynamic_value[]" value="$value[$i]">

     

    So, you get those values in the form submit page.

     

    * you haven't write action in form open tag and your submit works properly, there are no changes required.

     

    let me know any error you get.

  2. $sql = "UPDATE $table_name SETartist = '".mysql_real_escape_string($artist)."',song = '".mysql_real_escape_string($song)."',quote = '".mysql_real_escape_string($quote)."' WHERE quoteid =  ".mysql_real_escape_string($_REQUEST['quoteid'])."";

  3. It is not possible with two different tables. for single table you can do that

     

    $query = "INSERT INTO practice_user (name, email, password, dob, category, comments) VALUES ('$name', '$email', '$password', '$dob', '$category', '$comments'), ('$name', '$email', '$password', '$dob', '$category', '$comments'), ('$name', '$email', '$password', '$dob', '$category', '$comments'), ('$name', '$email', '$password', '$dob', '$category', '$comments'), ('$name', '$email', '$password', '$dob', '$category', '$comments')";

     

      $result = mysqli_query($dbc, $query)

     

     

  4. Hey  monsure,

     

    You should create one dedicated page of book_details.php and whenever you display overview page with title and author give a link to that particular page, see below code

     

    while($rows = mysql_fetch_assoc($result))
    {
    
    echo "-Title: <a href='book_details.php?id=".$rows['id']."'>" . $rows['title'] . "</a><br/>" . "-Author: " . $rows['author'] . "<br />";
    }
    

    On book_details.php page fetch a bookdetails from $_GET['id'] variable.

     

    Query should be

     

    $sql = "select * from book where title_id =".$_GET['id']

     

  5. try below code,

    $sql = "INSERT INTO `data` (`info`, `write`, `date`) VALUES";     for ($c=0; $c < $num; $c++) {             $sql.= "(";             $sql.= '"'.str_replace('"', "", $data[$c]).'",';             $sql.= "'".date('Y-m-d')."');";        }echo $sql;mysql_query($sql);

     

     

    your code will generate the query which you can execute once only.

  6. If I understand you properly then you can implement like this

    $query = mysql_query("SELECT * FROM table_name");

    while($row = mysql_fetch_array($query))

    {

    // you can apply explode here on each row data like name and school

     

    $name_arr = explode("-",$row["name"]);

    $school_arr = explode("-",$row["school"]);

     

    }

     

    I hope above code helps you.

     

×
×
  • 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.