Jump to content

roeyhaim

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by roeyhaim

  1. i have a form with some checkboxes. when the user want to edit his profile i need to take the data from the db an put it in the form. and when he updated his profile i need to put in the db the value of each choice. the problem is that i cannot do this on the same page with "if" statement. i need to send the whole data to a class and from there i need to insert it into the db.
  2. but i need also the value of the checkboxes which not checked. any idea?
  3. hello when i try to get the checkbox status from my class i get only those who checked i send the &_POST to my class. how should i get also the values of checkboxes which not selected?
  4. Thank you ras1986 it's work
  5. Not really. as i see on W3school: SELECT column_name(s) FROM table_name WHERE column_name operator value example: $result = mysql_query("SELECT * FROM Persons WHERE FirstName='Peter'"); and this is exactly what i did. the "uname" is the column and the $uname is the value.
  6. Hello, can anybody tell me whats wrong with my code: function check_login($uname, $pwd){ $sql = "SELECT * FROM users WHERE uname=$uname"; $result = mysql_query($sql) or die('Error, Load query failed: ' . mysql_error()); $data = array(); while($row=mysql_fetch_assoc($result)){ $data[] = $row; } return $data; } $chk = check_login("test", "test1"); foreach($chk as $row){ echo $row['uname']; echo " = "; echo $row['pass']; echo "<BR>"; } when i run this i get:
  7. Thanks i didn't notice for that line
  8. Hello. I'm new to php and need a little help please. I try to build a class that return an Array of all the table in my db. and be able to get all the data by there col name (like username, password....) but all i got is the last record from the db. here is the class: <?php class db{ function getall($table, $search){ $sql = "SELECT ". $search ." FROM " . $table; $result = mysql_query($sql) or die('Error, insert query failed' . mysql_error()); while($row=mysql_fetch_assoc($result)){ $data = $row; } return $data; } and this is in the html page: $data = $db->getall("users", "*"); foreach($data as $row){ echo $row['fullname']; echo "<BR>"; } can anybody help me with that?
×
×
  • 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.