Search Results

Search found 10 results on 1 pages for 'crays'.

Page 1/1 | 1 

  • PHP Variable with Array

    - by Crays
    Hi guys, i'm trying to make a "update user's power" page. It is something similar to those you can find in say, invisionfree forums. I need it to generate a list of members with checkbox [done] Add an option for it [done] What i don't know how to do is to update, to say, give all the selected users the selected power. Then i went searching for something and found most of them uses array to do this, but i never found one that actually explains how it works. The example i took (with my own modification) was this: while($row = mysql_fetch_array($result)) { echo '<tr>'.$id[]=$rows['id'].''; echo '<td width="50px" align="center" class="TableFormCell"><input type="checkbox" name="option[]" /></td>'; echo '<td width="170px" align="center" class="TableFormCell">'.$row['uname'].'</td>'; echo '</tr>'; } I'm not sure what exactly $id[]=$rows['id'] does I know after the row, my option[] would become an array of option[1], option[2], option[3] for what power should be given, i've got no problem with that but on how to update the database i'm got no clue... for($i=0;$i<$count;$i++){ $sql1="UPDATE ninos SET power='$power' WHERE id='$option[$i]'"; $result1=mysql_query($sql1); } So Say i have 5 users, Aye, Bee, Cee, Dee, Eee with IDs of 1,2,3,4,5 how can i make it so that my script would run like $sql1="UPDATE ninos SET power = '$power' Where id='1','2','3','4','5'"; Please help, thanks.

    Read the article

  • [SQL] How to SELECT TOP 5 and then the following 5?

    - by Crays
    Hi guys, as the comments always have it, you can select to show the top 5 comments (which i know how) and if there is more than 5, you can click a link and it will show the following 5 comments. The problem is that i don't know how the code should be for it to show the next 5. Better idea of what i'm saying Let's say i have 10 comments, i use SELECT * FROM news ORDER BY ID DESC LIMIT 5 that will show the TOP 5 comments say, the comments with ID 10,9,8,7,6 but what if i want the comments with ID 5,4,3,2,1 ?

    Read the article

  • Vertically Aligning Divs

    - by Crays
    Hi, i'm trying to make a small username and password input box. I would like to ask how do you vertically align a div? What i have is a <div id="Login" class="BlackStrip floatright"> <div id="Username" class="floatleft">Username<br>Password</div> <div id="Form" class="floatleft"> <form action="" method="post"> <input type="text" border="0"><br> <input type="password" border="0"> </form> </div> </div> and how can i make the div with id Username and Form to vertically align itself to the center? I tried putting vertical-align: middle; in css for the div with id Login. But doesn't seem to work. Any help would be appreciated. Thanks.

    Read the article

  • Selecting two field in MySQL with PHP

    - by Crays
    Hi guys, i'm relatively new to php and mysql and would like to know how to select two value in mysql with php. What i have is $query = sprintf("SELECT COUNT(id) FROM table WHERE UPPER(username) = UPPER('%s') AND password='%s'"... in this case, i'm only selecting and count if the id exist and i use list($count) = mysql_fetch_row($result); if($count == 1) and by using cookies, i would like to retrieve two value from the database, namely user (the user's name) and power (which has value of 1,2 or 3, indicating the menu they would be able to see) basically it is to differentiate if you're admin or normal user, but i wonder if i could do SELECT COUNT(id) AND power FROM table WHERE ... is this possible? or is there any other way? Please guide me, thanks.

    Read the article

  • Update successful notice with pure css and a close button

    - by Crays
    Hi guys, i've seen websites that allow you to say update your profile and when the stuff is done, they'll stay in the same page or redirect you to another and with a fancy notice that says "Update successful. click here to close" with a lowered opacity black background and a box in the middle with the text within. I've got most of the stuff, the lowred opacity black background, the middle box with the text and even the click here to close function. But how i did the "Click here to close" function is by using a link. Let's say after updating the profile, my script redirect me to index.php?update=successful then i use $update = $_GET['update']; if ($update == "successful") { echo '<div id="BlackScreen"><p id="MiddleBox">You\'ve successfully update your status!<br><span class="close"><a class="menu" href="index.php">Click to close. </a></span></div></div>'; } so that the lowered opacity background div will be gone, but is there another way to do this? Any tips please?

    Read the article

  • jquery toggling more than one div

    - by Crays
    Hi guys, i'm trying to make toggling div with only 1 javascript. I tried this, the first div does what it was meant to do but the second doesn't. Have a look. <body> <div> <div>He <div>You <div id="Me"><a id="me">Me</a></div> </div> </div> <div id="This">We </div> </div> <div> <div>1 <div>2 <div id="Me"><a id="me">3</a></div> </div> </div> <div id="This">4 </div> </div> <script> $("#me").click(function () { $(this).parent().parent().parent().siblings("#This").slideToggle("slow"); }); </script> </body> when i click me, we disappear, alright. But when i click 3, 4 doesn't disappear.

    Read the article

  • Wordpress sidebar border

    - by Crays
    Hi, i would like to add an image that acts like a border after every list in the sidebar. I knew it has something to do with this #sidebar h2 { border-bottom: 1px solid #d6d6d6; } since i tried that code and a border appeared. But what i wanted is a picture, i could do that with in the posts with: .TitleBorder { background: url(images/border.png) repeat-x; height: 3px; width: 615px; } and <div class="TitleBorder"></div> but in sidebar, i can't do that. Any help?

    Read the article

  • Auto update after specific day passed

    - by Crays
    Hey guys, i've this theme of the week script, easy, just post like normally, save in database and echo it in a column. But since its theme of the week, i would like it to automatically renew the value to say "none" or "not set" after a week. I know cron jobs could do this but is there another way? [Running in PHP]

    Read the article

  • jquery adding required to a dropdownbox [SOLVED]

    - by Crays
    Hi i would like to know how do i add a required attribute to a dropdownbox? I've search numerous ways but none worked, here's my code <script> $(document).ready(function(){ $('.orderingmenu .burgers').change(function(){ var selectVal= $(this).val(); if(selectVal != 'none'){ $(this).next().attr('required', true); } }); }); </script> i am really out of idea on how to do this, i tested the selectors and they're working fine, but it just doesn't seem to add in the required attribute to that select field =/ any help please? what i have tried is $(this).next().prop('required', true); $(this).next().attr('required', 'true'); $(this).next().attr('required', ''); $(this).next().prop('required'); none have worked =/ EDIT the HTML <div class="orderingmenu" style="margin-bottom: 0.5%;"> <select name="burgerlist" class="burgers" style="width: 35%; float: left; font-size: 12px;"> <option selected="selected" value="none">NONE</option> <option value="A">A</option> </select> <select name="option" id="option" class="setornot" style="width: 30%; font-size: 12px;"> <option selected="selected" value="none">NONE</option> <option value="ALA CARTE">ALA CARTE</option> <option value="SET">SET</option> </select> <input type="text" placeholder="ANY REMARKS?" name="remarks" style="width: 30%; float: right; font-size: 12px;"> </div> i had it looped with a php script, but basically what i wanted to do is so that if there is any selection other than 'none', the other selection is required. EDIT 2 found out the problem was that i had the value for none!

    Read the article

  • manipulating radio box selection with javascript

    - by Crays
    Hi guys, i'm trying to do a poll but i designed it without any radio box in it. So i decided to make the selection being highlighted with a different background color, all is done with jquery. I set the display of the radio box to none so that it wouldn't show, gave each a unique ID. Here's the script. <form action="v_poll.php" method="post"> <ul class="voting"> <li class="voting votetext"><input type="radio" name="voting" value="a1" style="display:none;" id="a1"><a onClick="vote('a1')"Answer 1</a></li> <li class="voting votetext"><input type="radio" name="voting" value="a2" style="display:none;" id="a2"><a onClick="vote('a2')">Answer 2</a></li> <li class="voting votetext"><input type="radio" name="voting" value="a3" style="display:none;" id="a3"><a onClick="vote('a3')">Answer 3</a></li> <input type="hidden" value="1" name="id" /> <input type="submit" value="submit"> </ul> </form> <script type="text/javascript"> function vote(TheValue) { GetElementById(TheValue).checked=true; } </script> But when i checked the value of the radio box with $_POST['voting'], it is blank. Not the value assigned to the radio box. Anything i'm doing wrong? Please help. Thanks.

    Read the article

1