MySQL / PHP dating site

Out of context: Reply #11

  • Started
  • Last post
  • 40 Responses
  • juhls0

    This is what I have so far

    $insert_id = mysqli_insert_id($oConn);

    $query2 = "INSERT INTO client_interests(client_id, interest) ". "VALUES ('$insert_id', ')";

    $result2 = mysqli_query($oConn, $query2) or die('Error querying database.');

    In the $query2 area...how can I write it out (simplest way) so that the interests (which the user has written out with commas in-between) is exploded into multiple rows?

    Something like this?

    $interest_list = implode(',', $interests);

    And/or an array?

    • maybe a for loop? for($i = 0; $i <= strlen($string); $i++){

      or is it simple...
      juhls

View thread