Jump to content

starrylitgal

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

starrylitgal's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok..thnx... but then how do i solve this problem?? is there any other function which accepts multiple queries and executes them?
  2. hi! i m having problem executing two queries together through my PHP code. Following is the code: $q1="CREATE TABLE `db`.`tb1`(`col1` tinyint(12),`col2` varchar(12)); CREATE TABLE `db`.`tb2` (`col1` int(12),`col2` varchar(12))"; mysql_query($q1) or die(mysql_error()); Is there nething wrong? This query is working properly when executed using phpmyadmin.... it always shows the following error: 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 'CREATE TABLE `db`.`tb2` at line 2' i tried to run it individually i.e. create these 2 tables (thru php code) separately like this : mysql_query($q1); mysql_query($q2); [$q2 being the second create table statement] and it successfully executed... but im not able to do it simultaneously in one query....wht is wrong??? i m not willing to run it separately coz i hav almost 28 queries to run and it wud mean running 28 queries separately....it wud be a long code...n as per my requirement i hav to chk its status of success for other operations...so.. plz does ne1 hav ne solution to this problem..! thnx!
  3. i wanted to know how to delete or move files stored on the server to some other location using PHP? i want to move all the files stored in a particular folder to some other location- Like the commands in windows for cutting and pasting files from one location to another, how do u do this using PHP?
  4. Can ne1 tell how to mark a topic as SOLVED? i m new here, i cant figure it out...saw the help section too ...cudnt find ne thing.
  5. thnx for the reply,mjdamato. ya, i was taking the value of each chkbox to be the id of the record . It wasnt working. I hav found out the problem. It was a PHP code problem. I used the dynamic array of the checkboxes only.Didnt make ne changes there. Changed the code instead. I guess discussing abt the code here would be irrelevant in this section of the forum.. But thanx a lot for the javascript, it works perfectly fine!! thanx a lot!!
  6. hi again! though my earlier prob was solved...there is one more problem... since the checkbox array is a dynamic one..so if the 1st and the third checkboxes are selected then the array stores the 1st checkbox value to an index 0 and the third checkbox value to an index 2... i want that whn the 1 & 3rd checkboxes are selected then corresponding values should have the respective indexes...i.e. 1st selected checkbox--index 0 3rd selected checkbox--index 2 how do i do that? i know how to do this in simple php without the use of dynamic checkbox array and without the javascript running....but im not able to do this with a dynamic array coz that is reqd for the javascript to work properly wht shd i do?!! does ne1 know how to do this??
  7. hey mjdamato!! thanx! it worked!!! thnx a lot!
  8. Hi guys! thnx dj kat for the reply. i used the following code: <SCRIPT LANGUAGE="JavaScript"> function Check(chk) { if(document.modifyform.master.checked==true){ for (i = 0; i < chk.length; i++) chk[i].checked = true ; }else{ for (i = 0; i < chk.length; i++) chk[i].checked = false ; } } </script> Here is the code for body part . <form name="modifyform" action="1.php" method="post"> <b>Sample Program</b><br> <input type="checkbox" name="master" value="yes" onClick="Check(document.modifyform.u)"><b>Check Control</b> <br/> <?php for($i=0;$i<5;$i++) {?> <input type="checkbox" name='u' value='<?php echo $i ?>'>ASP <?php echo $i ?><br> <?php } ?> <input type="submit" value="submit" name="gen"/> </form> I hav used the above code and it worked.... but i hav one problem... i want to store all the values of the selected checkboxes in an array form so that i can then determine wich checkboxes are checked(may be like a checkbox array)....n do some appropriate task.. i used the following code to check wht values were passed whn d form was submitted: <?php if(isset($_POST['submit'])) { for($i=0;$i<5;$i++) { echo $_POST['u']."<br/>"; } } ?> Output: 4 4 4 4 4 The system is taking the value of the last checkbox selected. I want the corresponding values of each checkbox selected. how do i do this? can some modifications in the above code help me to do this?? if yes, can ne1 suggest wht modifications hav to be made?? if the javascript has to be changed then plzz tell me wht r d changes coz i cant figure it out by myself. Thanx!
  9. i made a few typos...the code is: <form name="modifyform"> <table> <tr><th><input type="checkbox" name='master' onclick="selectall()"/></th></tr> <?php for($i=1;$i<=10;$i++) {?> <tr><td><input type='checkbox' name="u" value=\"$i\"/></td></tr> <?php } ?> </table> </form> can ne1 help me find the prob wid d code i posted earlier with this correction?
  10. i dont know javascript...so please if ne1 can give me the code...tht wud be gr8...coz currently i dont hav such time to actually sit n learn n then try to solve the prob...but wid whtevr programming knowledge i hav, i can understand the code.. plzz help! i have tried this code...but it is not working i dont know wht is the prob...if possible some1 plzz guide me thru this.. <script language="javascript"> function selectall() { var masterChecked = document.modifyform.master.checked; for(var i=1; i<=document.modifyform.elements.length;­ i++) { if(document.modifyform.elements[i].­type=="checkbox") document.modifyform.elements[i].checke­d = masterChecked; } } </script> HTML code: <tr> <th><input type="checkbox" name='master' onclick="selectall()"/></th><tr> <?php for($i=0;$i=10;$i++) {?> <tr><td><input type='checkbox' name="u" value=\"$i\"/></td><tr> <?php } ?>
  11. i did google it...i found few codes too and tried them ...but it wasnt working..wht do i do? i dont know javascript but since i hav programming knowledge i try to understand it....but i m not able to understand where hav i gone wrong. Wht shd i do?
  12. hi! i hav a form named "modify" which shows a list of usernames and along with each username, there is a textbox for entering passwords. Basically this form is for modifying the passwords of the existing users. Also, there is a checkbox along with each username and password row and 1 common checkbox called "master" in the 1st row of the table. I want this "master" checkbox to work as a select/deselect all option checkbox. Onclicking the "master" checkbox , all the checkboxes listed in the table of usernames and passwords should get checked/unchecked. How do i do that?? my code (relevant to the problem) looks like this:: <form name="modify"> <table> <tr> <th><input type="checkbox" name='master'/></th> <th >Name</th> <th>Username</th> <th>Enter New Password</th> </tr> <?php while($row=mysql_fetch_array($res)) {?> <tr align='center'> <td><input type='checkbox' /></td> <th>$row[name]</th> <th>$row[username]</th>"; <td><input type='password' name=pwd /></td></tr> <?php } ?> </table> </form> im doing dynamically retireving all the usernames , and the number of rows is therefore dynamic. functionality, the rows with the checkboxes selected will be updated with the new passwords. if the user wants to update all , then all the checkboxes shd be selected. For that, i need help! Help required is very urgent!
×
×
  • 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.