Jump to content

warhead2020

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

warhead2020's Achievements

Member

Member (2/5)

0

Reputation

  1. <level 1> <level 2> <level 3-1> text 1 </level 3-1> <level 3-2> This 1 </level 3-2> </level 2> <level 2> <level 3-1> text 1 </level 3-1> <level 3-2> This 2 </level 3-2> </level 2> <level 2> <level 3-1> text 1 </level 3-1> <level 3-2> This 3 </level 3-2> </level 2> </level 1> Hi, can someone help ni..how can i retrieve text node form 'level 3-2'?? My return data should be THIS 1,THIS 2,THIS 3. Thanks in advance.
  2. Hi, I am new to jquery. Only juz started to learn about 3 weeks ago. So i can say im a BEGINNER. Got 1 simple question. what is the different between '$.blabla' and '$().blabla'. Dollar sign ..and the other one...dollar sign+ bracket. Thanks in advance.
  3. Hi, I have this problem. Can someone help me,how to convert number of days(eg: 5000 days) into the format XX Years, XX Month, XX Days... thanks in advance.
  4. Hi, I have this problem. I want to get the difference between two dates(eg: 1997-09-09 And Curdates()), how to get the output to be in XX Years, XX Months, XX days?.. Hope someone can help me on this problem. Thanks in advance.
  5. Hi, i have one simple question regarding Inner Join. SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name If i change this code to this code SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name2.column_name=table_name1.column_name will the output still the same or different? Thank in advance.
  6. Actually, it's quite illogical to store a number as anything but a number. But still u can insert number into varchar column right? I jus want to know is there any effect to performance/size etc? Maybe your DB size will be bigger or anything?? just curious...
  7. Logically there is no problem to insert number into varchar right? But i need to know what happen if we insert number into varchar with 100 or more in size.
  8. Hi, Im quite new to mysql/DB. I have simple question. Lets say I want to create one column 'Number'. Yeah i know, the data type should be int/double. But if i declare it as 'Varchar(100)', is there any effect in term of performance/speed etc etc etc? I know to some ppl it is simple but for me its quite important. Thanx in advance.
  9. Hi, i have this problem regarding ajax dropdownlist. Here is my code. this is my ajax code function getXMLHTTP() { var xmlhttp=false; try { xmlhttp=new XMLHttpRequest(); } catch(e) { try { xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1) { xmlhttp=false; } } } return xmlhttp; } function getIpt(strURL) { var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('institusidiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } function getKursus(strURL) { var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('kursusdiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } Here is my php code (ajaxIPT.php) <?php require_once("../../class/class.mysqldb.php"); $code = intval($_REQUEST['code']); $kod_ins = $_REQUEST['kod_ins']; $con = new MysqlDB; $con->connectMysql(); if($code == 1) { $queryIpt = "select ctext from kod_ipt where kat_ipt = 1"; $resultQuery = $con->query($queryIpt); ?> <select name="INSTITUSI" id="INSTITUSI"> <option>--Choose--</option> <?php while($row=$con->fetch_array($resultQuery)) { ?> <option value="<?php echo $row['ctext']; ?>"><?php echo $row['ctext']; ?></option> <?php } ?> </select> <?php } elseif($code == 2) { $queryIpt = "select ctext from kod_ipt where kat_ipt = 2"; $resultQuery = $con->query($queryIpt); ?> <select name="INSTITUSI" id="INSTITUSI"> <option>--Choose--</option> <?php while($row=$con->fetch_array($resultQuery)) { ?> <option value="<?php echo $row['ctext']; ?>"><?php echo $row['ctext']; ?></option> <?php } ?> </select> <?php } elseif($code == 3) { ?> <input name="INSTITUSI" type="text" id="INSTITUSI" size="30" value="" /> <?php } elseif($code == 4) { ?> <input name="INSTITUSI" type="text" id="INSTITUSI" size="30" value="Test" /> <?php } ?> And this is my form <table width="100%" cellspacing="1" class="main"> <tr> <th width="25%"> <div align="left"> <strong>A</strong> </div> </th> <th align="center" width="2%"> <div align="center">:</div> </th> <td width="73%" class="bodystyle"> <select name="KOD_INSTITUSI" id="KOD_INSTITUSI" onchange="getIpt('ajaxIPT.php?code='+this.value),tukarPeringkat(this.value);"> <option value="">-Choose-</option> <?php while($row=$con->fetch_array($resultIptQuery)) { ?> <option value = "<?php echo $row['id']; ?>"><?php echo $row['cat']; ?></option> <?php } ?> </select> </td> </tr> <tr> <th> <div align="left"> <strong>B</strong> </div> </th> <th align="center"><div align="center">:</div></th> <td class="bodystyle"> <div id="institusidiv"> <select name="INSTITUSI" id="INSTITUSI" onchange=""> <option value="">-Choose-</option> </select> </div> </td> </tr> </table> this code works perfectly. When i choose KOD_INSTITUSI, the INSTITUSI dropdownlist change. The problem now is, when i post the form, the INSTITUSI IS NULL. It is like, the result in INSTITUSI dropdownlist only "virtually/temporarily"(sorry if im using wrong word ) exist there not the real object. That's y when i post the form, the INSTITUSI dropdownlist post NULL. I think maybe it is because the way i send data from ajaxIPT.php to the ajax code?? Hope someone out there can help me. Thanks in advance.
  10. oh ok....i found the real culprit here... actually i just copy and paste tutorial from PDF...so actually there r using ‘ but when i paste it in notepad...it is actually diff character. anyway..many2 thanx from me.
  11. YES! It works! im in BLANK MODE now..can u see what is the diff between ur code and mine... CREATE TABLE `categories` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR( 255 ) NOT NULL , `shortdesc` VARCHAR( 255 ) NOT NULL , `longdesc` TEXT NOT NULL , `status` ENUM( 'active', 'inactive' ) NOT NULL , `parentid` INT NOT NULL , PRIMARY KEY ( `id` ) ) TYPE = MYISAM ; this is urs...it works. CREATE TABLE ‘categories’ ( ‘id’ INT NOT NULL AUTO_INCREMENT , ‘name’ VARCHAR( 255 ) NOT NULL , ‘shortdesc’ VARCHAR( 255 ) NOT NULL , ‘longdesc’ TEXT NOT NULL , ‘status’ ENUM( ‘active’, ‘inactive’ ) NOT NULL , ‘parentid’ INT NOT NULL , PRIMARY KEY ( `id` ) ) TYPE = MYISAM ; this is mine.. can detect anything??
  12. sory ..i stil cant understand it....what is the diff between mine and urs? PRIMARY KEY ( `id` )
  13. ..sory wrong quote stil error... #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''id' ) ) TYPE = MYISAM' at line 8
×
×
  • 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.