Jump to content

Search the Community

Showing results for tags 'checkbox mysql php database'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, Im new here, I had read some of your post in order to find what im looking for... here is my issue: Im using php and mysql (the mysql table have 2 foreign keys) I have a form with some checkboxes, this section is filled with a select because the items are from another table so my problem is when I try to do the insert in the database, the problem are the checkboxes and I really dont know how can i get the values or how can i solve my problem. This Is how I print the list of items in checkboxes <p><label>career:</label></p> <table border="0"><td><p><? $sql = "SELECT * FROM career ORDER BY id_career asc"; $res = mysql_query($sql); $c=0; while($row = mysql_fetch_assoc($res)){ $vector[$c] = $row['career']; $c++; } for($f=0;$f<$c;$f++){ ?> <input type="checkbox" name="career[]" id="career[]" value="<? echo $career; ?>"> <? $career= $vector[$f]; echo $vector[$f]; echo "<br>";}?></p> </td></table> Then my form have an action=" " but is conected to 'function save' (is where i have my php code) <? function save_career($name,$gender,$status,$id_client,$id_career){ $name=$_POST['name']; $gender=$_POST['gender']; $status="inactive"; $query = "insert into career(id_career,name,gender,status,id_client,id_career) values(0, '$name','$gender','$status',$id_client,$id_career)"; mysql_query($query); echo $query; } ?> I hope someone can help me because i tried lots of ways to solve this... Greetings!
×
×
  • 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.