Jump to content

zeinaK

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by zeinaK

  1. Thank you! It said that the error was near the WHERE, the $Stat was actually posted empty and I missed it. All fixed now! Thank you again
  2. I have tried everything except using mysql_affected_rows(), the mysql_query() returns nothing, I made sure that the $id exist and that the $stat is numeric.
  3. Hello, I am trying to update my database using a form. While submitting this function is called, but nothing is changed. If I replace the variables with values, the function works fine, but not with variables. function updateCandidate($id, $F_Name, $L_Name, $Gender, $Bday, $PhoneNo, $Address, $City, $Country, $Nationality, $experience, $Stat) { $q = "UPDATE candidates SET F_Name = '$F_Name', L_Name='$L_Name', Gender='$Gender', Bday='$Bday', PhoneNo='$PhoneNo', Address = '$Address', City='$City', Country = '$Country', Nationality = '$Nationality', Experience_idExperience='$experience', Status= $Stat WHERE Users_UsersID = $id"; return mysql_query($q, $this->connection);
  4. Hi, A quick question please , I am trying to assign a selected index to a drop down list based on data retrieved from the database. I tried using JavaScript : document.getElementById('Country').selectedIndex =".$array['Country]."'; but it does work. Any suggestion?
  5. Sorry for the late reply and thank for the help
  6. Hello, I am trying to get a list of elements from my Database and I need to save it in a JavaScript array. Here is what I've been trying to do. mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $query="SELECT idCountries, Country_Name FROM countries order by Country_Name "; $result = mysql_query ($query); $x=1; echo "<script type='text/javascript'>"; echo "var SelAry=[];"; echo "SelAry[0] = ['select', '0'];"; while($nt=mysql_fetch_array($result)) { echo "SelAry[$x]=['$nt[idCountries]', '$nt[Country_Name]']; "; $x++; } echo "</script>"; I am open to any suggestion. Thank you in advance.
×
×
  • 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.