Jump to content

ramjai

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ramjai's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $type1=pg_query("select max(type) from type where layerid=$lay AND categoryid='$cat3'"); $type2=pg_num_rows($type1); $typ=pg_fetch_object($type1); echo $typ->type;
  2. Hi everybosy, Any one can help me how to alter the column datatype which is set as primary key for one table and foreign for the second table
  3. Hi all, I have three combo boxes, when i select a value in the first combo box, the second combo box should populate automatically and depending upon the second combo box the third should populate automatically. But i am getting the following error: lay[0] = "rawmaterial"; cat[0] = [ "IC"scat[0] = [ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /opt/lampp/htdocs/combo.php on line 30 ]; , "MOSFET"scat[0] = [ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /opt/lampp/htdocs/combo.php on line 30 ]; ]; lay[1] = "Semi finished Product"; cat[1] = []; Choose a layer Choose a category Choose a subcategory: can u rectify my error in the following code.............. <?php ?> <html> <head> <script language="JavaScript"> var lay = new Array(); var cat = new Array(); var scat = new Array();</script> <?php $con = mysql_connect("localhost","root","jairam") or die('Could not connect'); mysql_select_db("ERP"); $makes = mysql_query("SELECT * FROM layer"); $make_count = 0; while($make_row = mysql_fetch_array($makes, MYSQL_ASSOC)) { echo "lay[".$make_count."] = \"".$make_row["layername"]."\";\n"; $models = mysql_query("SELECT categoryname FROM category WHERE layerid=".$make_row["layerid"]); $model_count = 0; $num_models = mysql_num_rows($models); echo "cat[".$make_count."] = ["; while($model_row = mysql_fetch_array($models, MYSQL_ASSOC)) { echo " \"".$model_row["categoryname"]."\""; $bittis = mysql_query("SELECT subcategoryname FROM subcategory WHERE categoryid=".$model_row["categoryid"]); $bitti_count=0; echo "scat[".$bitti_count."] = ["; while($bitti_row = mysql_fetch_array($bittis, MYSQL_ASSOC)) { echo "\"".$bitti_row["subcategoryname"]."\""; $bitti_count++; } echo "];\n"; $model_count++; if($model_count < $num_models) echo ", "; } echo "];\n"; $make_count++; } mysql_close($con); ?> <script> function populateMakes() { var makeSel = document.getElementById("layername"); makeSel.length = 0; for(var i=0; i<lay.length; i++) { makeSel.options = new Option(lay, lay); } } function doChangeOptions() { var modelSel = document.getElementById("categoryname"); modelSel.length = 0; var sel = document.getElementById("layername").selectedIndex; alert(sel); var currArr = cat[sel]; alert(currArr); for(var i=0; i<currArr.length; i++) { modelSel.options = new Option(currArr, currArr); } } function doChangeOptions1() { var bittiSel = document.getElementById("subcategoryname"); bittiSel.length = 0; var sel = document.getElementById("categoryname").selectedIndex; alert(sel); var currArr = scat[sel]; alert(currArr); for(var i=0; i<currArr.length; i++) { bittiSel.options = new Option(currArr, currArr); } } </script> </head> <body onload="populateMakes();doChangeOptions();doChangeOptions1();"> <P>Choose a layer <select id="layername" onchange="doChangeOptions()"> </select> </p> <p>Choose a category <select id="categoryname" onchange="doChangeOptions1()"> </select> </p> <p>Choose a subcategory: <select id="subcategoryname"> </select> </p> </body> </html>
  4. Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: could not translate host name "localhost,dbname=userlog,user=jeyanthi,password=jairam" to address: Name or service not known in /var/www/logins/abcd_bank/admin.php on line 12 can't connect
×
×
  • 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.