
esandra
Members-
Posts
40 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
esandra's Achievements

Member (2/5)
0
Reputation
-
how to populate dropdown with database names and table names?
esandra posted a topic in Applications
I'm using mysql and php..I'd like to see how the query should go if I want to display the existing database names on a dropdown, same thing with the table names -
if anyone could give me any suggestions on this
esandra replied to esandra's topic in PHP Coding Help
is it possible to simply fetch from the server(mySql) and then dump it online? -
How to do #3 by a PHP page instead? mainly so that there wouldn't be a need to export the sql after doing #2 then import it into the online phpmyadmin(#3) #1. Convert database from foxpro to sql #2. Change some fields in the sql table #3. Upload to phpmyadmin Is it possible to create a code to export from the server and then import the sql online? like by making use of mysql_fetch_array() and insert into
-
will I be allowed to repost this in that forum instead?
-
I want to have an array wherein I could push values every time the function is triggered when this button is clicked <img src="images/del.png" width="15" height="15" onclick="hide(<?php echo $y;?>)"> this will be called function hide(y){ y=y-1 var line="line"+y document.getElementById(line).style.display="none" //the array is supposed to be in here to record the values of all the $y that ever called this function }
-
if this image is clicked: <img src="images/del.png" width="15" height="15" onclick="hide(<?php echo $y;?>)"> this image should appear: <img src="images/undo.png" width="20" height="20" onclick="show(<?php echo $y;?>)" title="undo"> 2nd image won't replace the first one, it will appear somewhere else
-
this script autofills the next textbox with a value of the last input + 1 onchange. but what I want to do is to still let the user change the value of the second textbox? the only value that the user could change it to is the value equal to the value of the previous textbox or the prev value + 1 which is the autofill value right now here is what it does to simplify the picture: I type in 100 second textbox displays 101 when I try to change second textbox into 100, it goes back to 101 function autocomplt(y){ var x=100 //100 row by 5 column form (orno, billnmbr,...) for(var y = 1; y < x; y++) { var orno="orno"+y var billnmbr="billnmbr"+y var payor="payor"+y var arrastre="arrastre"+y var wharfage="wharfage"+y var ornoval = document.getElementById(orno).value; if(ornoval.length!=""){ var nxtorno = (ornoval*1) + 1; var nxty = y+1 orno="orno"+nxty billnmbr="billnmbr"+nxty payor="payor"+nxty arrastre="arrastre"+nxty wharfage="wharfage"+nxty document.getElementById(orno).readOnly = false; document.getElementById(billnmbr).readOnly = false; document.getElementById(payor).readOnly = false; document.getElementById(arrastre).readOnly = false; document.getElementById(wharfage).readOnly = false; document.getElementById(orno).value = nxtorno; //above auto fills the next textbox orno+y //but I want the user to be able to change the value break; //I temporarily put break here to keep it from auto filling up to the 100th textbox that I have //because it's only supposed to fill one textbox after it }} } also this event happens onchange of the first orno+y what do i do so that when I click on the second orno+y the 3rd orno+y would change its value into 2nd_txtbox_value + 1? so on and so forth... thank you for your time Here is the affected part of the form, just in case... <?php $num=100; $nump=$num / 10; $y=1; for($j=1;$j<=$nump;$j++){ ?> <li> <p> <?php for($i=1;$i<=10;$i++){ if(strlen($y)==1){ echo "0"; } if(strlen($y)==3){ echo $y."<font color=000000>....</font>"; } else{ echo $y." "; } ?> <input name="orno<?php echo $y;?>" id="orno<?php echo $y;?>" type="text" size="10" maxlength="6" onKeyPress="return isNumberKey(event)" value="<?php if (isset($_POST['orno'])) { echo htmlspecialchars($_POST['orno'], ENT_QUOTES); }?>" onchange="autocomplt(<?php echo $y;?>);" > <input name="billnmbr<?php echo $y;?>" id="billnmbr<?php echo $y;?>" type="text" size="25" maxlength="17" value="<?php if (isset($_POST['billnmbr'])) { echo htmlspecialchars($_POST['billnmbr'], ENT_QUOTES); }?>"> <input name="payor<?php echo $y;?>" id="payor<?php echo $y;?>" type="text" size="40" maxlength="50" value="<?php if (isset($_POST['payor'])) { echo htmlspecialchars($_POST['payor'], ENT_QUOTES); }?>"> <input name="arrastre<?php echo $y;?>" id="arrastre<?php echo $y;?>" type="text" size="10" maxlength="8" onKeyPress="return isMoneyKey(event)" value="<?php if (isset($_POST['arrastre'])) { echo htmlspecialchars($_POST['arrastre'], ENT_QUOTES); }?>" onchange="autototal(<?php echo $y; ?>);"> <input name="wharfage<?php echo $y;?>" id="wharfage<?php echo $y;?>" type="text" size="10" maxlength="8" onKeyPress="return isMoneyKey(event)" value="<?php if (isset($_POST['wharfage'])) { echo htmlspecialchars($_POST['wharfage'], ENT_QUOTES); }?>" onchange="autototal(<?php echo $y; ?>);"> <input name="total<?php echo $y;?>" id="total<?php echo $y;?>" type="text" size="10" onChange="return isMoneyKey(event)" value="<?php if (isset($_POST['total'])) { echo htmlspecialchars($_POST['total'], ENT_QUOTES); }?>" disabled="disabled"><br /> <?php $y++; echo "<input type=hidden name=y value=".$y.">"; }?> </p> </li> <?php $y=$y; }//} ?> </ul> </div>
-
this is a very messed up javascript...i apologize function autocomplete(y){ var orno = "orno"+y; for(var i=1;i<=100;i++){ var lastorno = document.getElementById(orno).value; //gets the maximum orno //ever entered var maxorno = document.write(Math.max(lastorno)); } alert(maxorno); var nxtorno = (maxorno*1) + 1; alert(nxtorno); document.getElementById(orno).value = nxtorno; }
-
I' trying to get the maximum value entered in the textbox by javascript..y is just part of the name of the textbox
-
I have several textboxes, each has the same id="orno<?php echo $y;?>" where y is a variable that is being incremented within the loop and I'm trying to get the maximum value that was entered in the text box orno<?php echo $y;?> here is my loop $num=100; $nump=$num / 10; $y=1; for($j=1;$j<=$nump;$j++){ for($i=1;$i<=10;$i++){ php $y++;
-
i'm trying to get the value of variable $y that loops up to 100 My problem is that it's in PHP and it's below my JS... here is my JS , what i'm trying to do with this script is to total a couple of textboxes onChange.. this is within a <head></head> function autototal() { var y = form1.y.value document.write(y); for(x =1; x <= y; x++) { var txtarr = form1.arrastre + y.value; var txtwhar = form1.wharfage + y.value; var totam = (txtarr-0) + (txtwhar-0) form1.total + y.value = totam; } } /////////////////////////////////////// here is my php loop , how i get $y this is inside <body></body> $num=100; $nump=$num / 10; $y=1; for($j=1;$j<=$nump;$j++){ for($i=1;$i<=10;$i++){ //some textboxes and text echo $y; } $y=$y; } now how do i get the value of $y so I could make my JS work? thank you for your time
-
I have 5 textboxes in 1 row.. .so, I have several rows with 5 textboxes per row
-
i'm updating several rows, how do I make the array thing work? How do I GET/POST/ or call the values from another page?
-
$y is my variable that I increment by a for loop. This variable determines the number of every row ..and then i'd concat'd $y with the name of the textboxes of every column and row name="orno<?php echo $y;?>" now, i'm not sure if i'm supposed to concat with the name or should it be with the id? HOW DO i CALL THE NAME FROM ANOTHER PAGE? this is what I did and I don't know if this is right $orno= $_POST['orno'.$y]; and since I know I may not be making much sense with my explaination above, this is my add_content.php where it all starts I've only included the part where the textboxes are displayed by/within a loop and where the names are concatenated with the variable $y. I have dropdowns and textboxes for the date and other elements above this. <div id="slider"> <ul> <?php $num=$_GET['num'];//this here represents the number of rows //of textboxes user wants to appear //there are 5 textboxes in one row and 10 rows in one page //this is a sliding page with jquery $nump=$num / 10; $y=1;//initializing y for($j=1;$j<=$nump;$j++){//determines how many pages then loops accordingly ?> <li> <p> <?php for($i=1;$i<=10;$i++){//loops 10 times to return 10 rows in a pages if(strlen($y)==1){ echo "0"; } echo $y." "; ?> <input name="orno<?php echo $y;?>" id="orno" type="text" size="3" maxlength="6" onKeyPress="return isNumberKey (event)" value="<?php if (isset($_POST['orno'])) { echo htmlspecialchars($_POST['orno'], ENT_QUOTES); }?>"> <input name="billnmbr<?php echo $y;?>" id="billnmbr" type="text" size="16" maxlength="17" value="<?php if (isset($_POST['billnmbr'])) { echo htmlspecialchars($_POST['billnmbr'], ENT_QUOTES); }?>"> <input name="payor<?php echo $y;?>" id="payor" type="text" size="35" maxlength="50" value="<?php if (isset($_POST['payor'])) { echo htmlspecialchars($_POST['payor'], ENT_QUOTES); }?>"> <input name="arrastre<?php echo $y;?>" id="arrastre" type="text" size="7" maxlength="8" onKeyPress="return isMoneyKey (event)" value="<?php if (isset($_POST['arrastre'])) { echo htmlspecialchars($_POST['arrastre'], ENT_QUOTES); }?>"> <input name="wharfage<?php echo $y;?>" id="wharfage" type="text" size="7" maxlength="8" onKeyPress="return isMoneyKey (event)" value="<?php if (isset($_POST['wharfage'])) { echo htmlspecialchars($_POST['wharfage'], ENT_QUOTES); }?>"><br /> <?php $y++; }?> </p> </li> <?php $y=$y; } ?> </ul> </div> then we go to add_save.php this page is still very lacking because I don't know how to evaluate then save multiple rows yet since I've originally done a page that saves one row at a time in which the textboxes' names aren't from a loop and were not concatenated. <?php //please take a look at how I am calling the $_POSTs from the prev page //what is the right way of calling concatenated names? //or if there is a better way of calling these please let me know.. $year=$_POST['year']; $month=$_POST['month']; $day=$_POST['day']; $date=$year."-".$month."-".$day; $billnmbr=$_POST['billnmbr'.$y]; $orno= $_POST['orno'.$y]; $payor=$_POST['payor'.$y]; $arrastre=$_POST['arrastre'.$y]; $wharfage=$_POST['wharfage'.$y]; $total=$arrastre + $wharfage; $tcl=$_POST['tcl']; $preparedby=$_POST['preparedby']; $notedby=$_POST['notedby']; $addedby=$_POST['addedby']; $office=$_POST['office']; if($_POST['btnadd']){ if($billnmbr=="" or $orno=="" or $payor=="" or $arrastre=="" or $wharfage=="" or $year=="" or $month=="" or $day=="" or $tcl=="" or $preparedby=="" or $notedby=="" or $addedby=="" or $date=='2010-01-01'){ ?> <script> alert ('At least one field was left blank!'); </script> <?php } else{ $query = mysql_query("select * from `arrastre` WHERE `billnmbr`='$billnmbr'"); $count = mysql_num_rows($query); if($count==1){//existing billnmbr echo "This billnumber is already in the database."; } else{ $bll = strtoupper($billnmbr); $explode_bill=explode("-",$bll); $bill1 = 0; $bill2 = 0; $bill1 = $explode_bill[0]; $bill2 = $explode_bill[1]; if(strlen($bill2)<6 && strlen($bll)!=17){ if(strlen($bill2)==1){ $rep = "00000"; $bll = $bill1."-".$rep."".$bill2; } elseif(strlen($bill2)==2){ $rep = "0000"; $bll = $bill1."-".$rep."".$bill2; } elseif(strlen($bill2)==3){ $rep = "000"; $bll = $bill1."-".$rep."".$bill2; } elseif(strlen($bill2)==4){ $rep = "00"; $bll = $bill1."-".$rep."".$bill2; } elseif(strlen($bill2)==5){ $rep = "0"; $bll = $bill1."-".$rep."".$bill2; } } $payr = strtoupper($payor); $query="insert into `arrastre` values ('0', '$orno', '$bll','$payr', '$arrastre', '$wharfage', '$total', '$date', '$tcl', '$preparedby', '$notedby', '$addedby', '$office')"; $result=mysql_query($query); ?> <?php }}} ?> thank you very much