Jump to content

robert_gsfame

Members
  • Posts

    876
  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. how can i retrieve the data from database n put those directly to the second combobox using javascript....don't have any idea on how to do it.. i really wish to use Javascript as page doesnt need to reload so let say i have this in database country city America Chicago;Texas;Las Vegas n i choose America from first combobox, how can i retrieve all cities from database without reloading the page??using javascript..
  2. i think so...its like this there are 3 combobox the first combobox is country where i can write it without using any javascript <option>America</option><option>Belgium</option> and each country will fill the second combobox so if i choose america n all cities in america will appear in my second combobox and finally the second will affect the third one which is the area code.... So can u give me some example on how to write those efficiently??
  3. It's impossible to remove any part of the code as everything is necessary. I put the javascript inside my php page, can i also GZIP it?? i am really new to GZIP
  4. I just wanna ask, i have used lots of javascript function in one of my page and i found the size of it is over 1 MB, i dont have any idea on how to reduce the size of it as all code is necessary.....how long will it take to open this huge size of page. Thx
  5. I have two form n i wish to move the record from first form to another form var lengthx=document.form4.elements.length; var length=document.form3.elements.length; var choosex=""; for(var x=0;x<lengthx;x++){ if(document.form4.elements[x].type=="checkbox"){ for(var y=0;y<length;y++){ if(document.form4.elements[x].value!==document.form3.elements[y].value){ choosex=choosex+"<tr><td>"+document.form3.elements[y].value+"</td></tr>";}}}} document.getElementById("datauser").innerHTML="<form name=form4><table width=357>"+choose+"</table></form>"; } when i choose one record from form3, everything goes correctly...but when i choose more records at the same time then records in form3 duplicate so if let say i have 4 records and i choose 2 records then i will have 8 records which part of looping is incorrect?? thx
  6. I have this html code <input type="checkbox" value="A" id="ITS_A"> and i want to get both value and id is it possible??
  7. I've learnt a lot about PHP here, this forum really helpful and boost my PHP knowledge....GREAT!!!! : THX to this great forum and all PHP Freaks Master!! ;D
  8. if i have autoincrement column like for example: I have 3 columns : ID (auto increment), Name, city Then if i want to insert some records, can i use INSERT INTO TABLE1 VALUES('James','Japan') which mean ignoring the ID or i still have to create this INSERT INTO TABLE1 (Name,City)VALUES('James','Japan') thanks
  9. I have this kind of query function clean($string) { if(get_magic_quotes_gpc()) { return stripslashes($string); }else{ return $string; } } function check($data) { return empty($data) ? 'NULL': "'".mysql_real_escape_string(clean($data))."'"; } $checkquery=mysql_query(sprintf("SELECT * FROM TABLE1 WHERE email=%s AND column1=%s AND column2=%s AND column3=%s", check($email), check($columnfill1), check($columnfill2), check($columnfill3))); $checknumrow=mysql_num_rows($checkquery); if(!empty($checknumrow)){}else if((!empty($email))&&(!empty($columnfill1))&&(!empty($columnfill2))){ $insertquery=mysql_query(sprintf("INSERT INTO TABLE1 VALUES(%s,%s,%s,%s)", check($email), check($columnfill1), check($columnfill2), check($columnfill3))));} All user input will be then checked whether it has been exist, if true then no record will be added into database. When using double single quotes '' instead of having NULL inside database, i dont get any problem..but then when i modify the code and wish to have a null value assigned, i get this problem where record added and added although they already exist which part is wrong? thanks
  10. I have this mysql_query(sprintf("UPDATE TABLE1 SET photo=NULL WHERE username='%s'", mysql_real_escape_string($session))); then i didnt find NULL value inside the photo column, only blank ???really confused
  11. okay , i thought that i have to set everything to NULL...so that when i use it inside php, then they will still read it as empty..so then the problem is in mysql, as i try to do this WHERE folder='' and the other one with this WHERE folder IS NULL, different records will be displayed for those similar query.....
  12. I try folder=NULL OR folder='' but still i found wrong records shown up....
  13. If i insert a data in mysql with single quotes let say INSERT INTO TABLE1 (photo)VALUES('') and the other one with this INSERT INTO TABLE1 (photo)VALUES(NULL) Will there any problem when i call it let say if(empty($photo)){echo "No photo";}else{echo "<img src blablabla Will both of records give me the same result which is "No photo" In simple words, is double single quotes still read as empty?? thx
  14. Yess!!! i got it now!! thank you so much for your help!!
  15. so if i write like what u did, then i cannot use sprintf()
  16. $test="NULL" Is this still correct??? mysql_query(sprintf("INSERT INTO table1(column1)VALUES('%s')", mysql_real_escape_string($test)));
  17. I just realise that single quotes '' and NULL will completely give me different result and now i have another problem, how can i insert NULL value into database but still using mysql_real_escape_string() ?? yet if i have '' and Null , and i use if(empty()) will all records with both NULL and '' still can be retrieved thanks in advance
  18. I have query like this SELECT * FROM table1 WHERE folder='' the problem is no result appear when using that query, then i change to folder is NULL and it works.. What is the different between those two ??? if i want to have any records where folder is empty then which one should i use NULL or ''???
  19. oops i miss the first part /\b[0-9]+$/;
  20. I wish to validate textbox so that anything besides numeric is not allowed I try to use isNan but not working (don't know why) then i try to use match() here is the code var test = /[0-9]+$/; if(!(mystring.match(test)) alert("wrong");} when i type "1234abc" alert appear but when i type "abc1234" alert not appear which part should be modified? thx 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.