Jump to content

Ritual29

New Members
  • Posts

    4
  • Joined

  • Last visited

Ritual29's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm not totally sure what you are trying to do. It looks like you are inserting an array into your table? Is there no other way to do this? I think you can better make separate fields in your table for the values you're inserting. Besides of that, an insert query doesn't work with 'SET', you use this with an update query. the proper syntax is INSERT INTO table (field1, field2) VALUES (value1, value2) I don't know if you can use it, but you have to figure out yourself how to use it in your situation then. You can also use a select query inside the insert query, just google for how to use a subquery.
  2. ok, I didn't know that. I edited my code to what you suggested. But it's still not working. this is what I have now function Getkmww() { if (document.getElementById("postcodeeindww").length==0) { document.getElementById("kmww").value=''; return; } var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("kmww").value=xmlhttp.responseText; } } var postcodebeginww = document.getElementById("postcodebeginww").value; var postcodeeindww = document.getElementById("postcodeeindww").value; xmlhttp.open("GET","getkm.php?b="+postcodebeginww"&e="+postcodeeindww,true); xmlhttp.send(); }
  3. Ritual29

    mySQL date

    I'm not familiar with the php method, but it's way better to let mysql do the formatting. mysql can do this alot quicker than php. mysql has a special built in function for it. So I recommend to use that.
  4. I'm trying to do something with Ajax for the first time, so bear with me. I've been searching google for some tutorials and I came up with this so far. I'm busy with a script that should return the distance in km's between two postal codes. I only can't get it to work. Nothing happens when I leave the field. getkm.php works fine, I already tested that. Does somebody see what the problem is? function Getkmww() { if (document.getElementById("postcodeeindww").length==0) { document.getElementById("kmww").innerHTML=""; return; } var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("kmww").innerHTML=xmlhttp.responseText; } } var postcodebeginww = document.getElementById("postcodebeginww"); var postcodeeindww = document.getElementById("postcodeeindww"); xmlhttp.open("GET","getkm.php?b="+postcodebeginww"&e="+postcodeeindww,true); xmlhttp.send(); } And this is the form <tr> <td id="adduren_description">Postcodes</td> <td id="adduren_fields"> <input type="text" name="postcodebeginww" id="postcodebeginww" size="6" value="<?php echo $_POST['postcodebeginww']; ?>"> <input type="text" name="postcodeeindww" id="postcodeeindww" size="6" value="<?php echo $_POST['postcodeeindww']; ?>" onblur="Getkmww()"> </td> </tr> <tr> <td id="adduren_description">Km Woon-Werk</td> <td id="adduren_fields"><input type="text" name="kmww" id="kmww" size="6" value="<?php echo $_POST['kmww']; ?>"></td> </tr>
  5. I registered to this forum today because I sometimes have a problem when I'm busy scripting a website. And this is now also the case by the way. It's been a while since I made some websites, only some maintenance. The forums where I usually came are pretty much deserted, so there is no fun anymore. I'm 24, and have about 5 years experience in scripting websites, and keep me busy with mostly php and mysql. I hope to find a lot of nice people here where we can discuss over all sorts of things, and that we can help eachother.
×
×
  • 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.