Search Results

Search found 27691 results on 1108 pages for 'multi select'.

Page 58/1108 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • How to make <option selected="selected"> set by MySql and PHP?

    - by Binyamin
    How to make <option selected="selected"> set by MySql and PHP? My code: echo '<select>'; $tempholder = array(); $rs = mysql_query("SELECT * FROM id ORDER BY year"); $nr = mysql_num_rows($rs); for ($i=0; $i<$nr; $i++){ //if($year=$r["year"]){ $selected=' selected="selected"'; }//doesn't work so $r = mysql_fetch_array($rs); if (!in_array($r['year'], $tempholder)){ $tempholder[$i] = $r['year']; echo "<option>".$r["year"]."</option>";//<option$selected>... } } unset($tempholder); echo '</select>';

    Read the article

  • How to order by results from 2 seperate tables in PHP and MySQL.

    - by Vafello
    I am trying to output results of 2 sql queries to one JSON file. The problem is that I would like to order them ascending by distance which is the result of equation that takes homelat and homelon from the users table and lat, lng from locations table.(basically it takes lattitude and longitude of one point and another and computes the distance between these points). Is it possible to take some parameters from both select queries, compute it and output the result in ascending order? $wynik = mysql_query("SELECT homelat, homelon FROM users WHERE guid='2'") or die(mysql_error()); ; $query = "SELECT * FROM locations WHERE timestamp"; $result = map_query($query); $points = array(); while ($aaa = mysql_fetch_assoc($wynik)) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { array_push($points, array('name'=>$row['name'], 'lat'=>$row['lat'], 'lng'=>$row['lng'], 'description'=>$row['description'], 'eventType'=>$row['eventType'], 'date'=>$row['date'], 'isotime'=>date('c', ($row['timestamp'])), 'homelat'=>$aaa['homelat'], 'homelon'=>$aaa['homelon'])); } echo json_encode(array("Locations"=>$points));

    Read the article

  • how to get option title="sample" using jquery

    - by tom
    Hi, I'm trying to update a hidden field based on the a title attribute on a select option, I've tried the code bellow and can't seem to get it to work. Thanks for any help! <form> <select id="selectbox"> <option name="test" value="one" title="title" selected="selected">one</option> <option name="test2" value="two" title="title2">two</option> </select> </form> <input id="update" type="hidden" value="defaultold" /> <script> $('#update').val('default'); $('#selectbox').change(function() { $('#update').val($(this).attr("title")); }); </script>

    Read the article

  • Grabbing the right record in a drop down from mysql

    - by 86Stang
    I'm using a form where the user can edit an entry. Everything is populating and all is well with the exception that I can't get the drop down to show the project that they've already assigned the image to. $project_qry = "SELECT * from projects ORDER BY title ASC"; $project_res = mysql_query($project_qry); $project_drop = "<select name=\"project_id\">\n"; while ($row = mysql_fetch_array($project_res)) { if ($project_id == $row[title]) { $project_drop .= "<option value=\"$row[id]\" selected>$row[title]</option>\n"; } else { $project_drop .= "<option value=\"$row[id]\">$row[title]</option>\n"; } } $project_drop .= "</select>\n"; I'm sure it's something devilishly simple but I'm stumped.

    Read the article

  • Monitoring MySQL SELECT/WRITE/UPDATE/SLOW queries in Nagios

    - by imaginative
    There's ways to get performance graphs with several monitoring software packages out there such as ZenOSS. There's a plugin available that will graph MySQL based SELECT/WRITE/SLOW queries in a nice rrd style graph. I'm curious if there is a way to also get similar graphs available in Nagios 3.0? I know Nagios has tools like pnp and can integrate rrd, but is there something readily available that can plugin to monitor those MySQL specifics?

    Read the article

  • Are there any Acrobat plugins or standalone programs that allow one to select and extract individual

    - by user30525
    We use BCL Jade currently but are running into problems because it isn't supported or sold anymore, doesn't work on Acrobat 8 or 9, and has some other issues. Other than that though it works great! :) Is there anything like it that allows users to select zones to extract? I see a simaler question on here and and an answer that suggests this http://pdftohtml.sourceforge.net/ but ideally we would want something nonprogrammers could use.

    Read the article

  • Read/Select:Connection reset by peer (10054) during remote logoff in RealVNC

    - by Santhosh
    I am using RealVNC 4.5 Enterprise on my Windows 7 client. I use this to connect to a remote system which is also running RealVNC 4.5 (on Windows 7 again). And then i logoff the remote system (server) and all of a sudden the realvnc viewer on the client closes with the message : "Read/Select:Connection reset by peer (10054)" It also asks if i want to reconnect again. Any idea why this is happening and how do i resolve this?

    Read the article

  • OneNote 2010 shortcut to select Pen #1, OR shortcut to access "Quick Access Toolbar"

    - by bobobobo
    Can you assign a keyboard shortcut to the commands you've placed in OneNote 2010's "Quick Access Toolbar"? CTRL+1, CTRL+2 or something.. What I really want to do is have a keyboard shortcut to select Pen #1, Pen #2 etc, but since I placed the pens in the "Quick Access Toolbar" I'd be happy if I could type a keyboard shortcut to access those. This is a pretty comprehensive list of known shortcuts

    Read the article

  • Read/Select:Connection reset by peer (10054) during remote logoff in RealVNC

    - by Santhosh
    I am using RealVNC 4.5 Enterprise on my Windows 7 client. I use this to connect to a remote system which is also running RealVNC 4.5 (on Windows 7 again). And then i logoff the remote system (server) and all of a sudden the realvnc viewer on the client closes with the message : "Read/Select:Connection reset by peer (10054)" It also asks if i want to reconnect again. Any idea why this is happening and how do i resolve this?

    Read the article

  • How to open the Select Users, Computers, Service Accounts or Groups

    - by Dave Rook
    The only way I know how to open the Select Users, Computers, Service Accounts or Groups is by right clicking on a folder and selecting Properties - Security Tab - Edit - Advanced. Below is a screen shot of the window I want to access: Is there any other way to view the full list (Find Now)? I am writing documentation and I want the user to check if a user exists before creating it. I would ideally like them to access this via control panel or similar.

    Read the article

  • Select part of a text that exists already in an above cell

    - by pragadheesh
    How do I get Excel to partially auto-complete a word using another that already exist in the same worksheet? Let's say I have the word "Microsoft" in a cell and in the cell below I want to type the word "Microhard". When I start typing Microhard, the word Microsoft appears shaded in black. How can I select the "Micro" part alone from Microsoft and continue to fill out the rest with "hard" without it trying to fill out as Microsoft?

    Read the article

  • iTunes video black screen until select computer output

    - by Daniel Huckstep
    I don't remember this happening before, but now whenever I play any video in iTunes (podcast video, movie, TV show, iTunes extras stuff but the menus work) it just shows a black screen with the sound playing. If I stop it, select "Computer" in the little output control on the iTunes video control panel that pops up, then play again, it works fine. What the heck? Tried rebooting, updating, with and without external monitor. OSX 10.6.6

    Read the article

  • iTunes video black screen until select computer output

    - by Daniel Huckstep
    I don't remember this happening before, but now whenever I play any video in iTunes (podcast video, movie, TV show, iTunes extras stuff but the menus work) it just shows a black screen with the sound playing. If I stop it, select "Computer" in the little output control on the iTunes video control panel that pops up, then play again, it works fine. What the heck? Tried rebooting, updating, with and without external monitor. OSX 10.6.6

    Read the article

  • Hibernate Que related to database i want select query generic without using property name

    - by Sudhir Gudhe
    Hi My que is i tried to get the data from data base using String SQL_QUERY ="from dat_personal_info "; Query query = session.createQuery(SQL_QUERY); for( it=query.iterate();it.hasNext();) { Object[] rowObject =(Object[]) it.next(); } but error occurs Hibernate: select dat_person0_.row_id as col_0_0_ from dat_personal_info dat_per son0_ java.lang.ClassCastException: bn.com.server.database.maptables.dat_personal_info $$EnhancerByCGLIB$$e1ffd36e cannot be cast to [Ljava.lang.Object; pls any who ans pls reply Thanks & Regards Sudhir gudhe

    Read the article

  • Keep div:hover open when changing nested select box

    - by JMC Creative
    This is an IE-only problem. .toolTip becomes visible when it's parent element is :hovered over. Inside of .toolTip is a select box. When the user opens the select box to make a selection, the parent element is being "un-hovered", if you will. To put it another way, when I try to select something from the dropdown, the whole thing hides itself again. I'm sure it has something to do with the way IE interprets the stylesheet, but I don't know what or where. Here is some relevant code (edited for clarity): #toolBar .toolTip { position: absolute; display:none; background: #fff; line-height: 1em; font-size: .8em; min-width: 300px; bottom: 47px; left: -5px; padding: 0 ; } #toolBar div:hover .toolTip { display:block; } and <div id="toolBar"> <div class="socialIcon"> <a href=""><img src="/im/social/nytimes.png" alt="NY Times Bestsellers" /></a> <span class="toolTip"> <h1>NY Times Bestsellers Lists</h1> <div id="nyTimesBestsellers"> <?php include('/ny-times-bestseller-feed.php') ?> </div> <p><img src="/im/social/nytimes.png" alt="NY Times Bestseller Lists" /> Change List <select id="nyTimesChangeCurrentList" name="nyTimesChangeCurrentList"> <option value="hardcover-fiction">Hardcover Fiction</option> <option value="hardcover-nonfiction">Hardcover Nonfiction</option> <option value="hardcover-advice">Hardcover Advice</option> </select> </p> </span> </div> </div>

    Read the article

  • Mysql select - improve performances

    - by realshadow
    Hey, I am working on an e-shop which sells products only via loans. I display 10 products per page in any category, each product has 3 different price tags - 3 different loan types. Everything went pretty well during testing time, query execution time was perfect, but today when transfered the changes to the production server, the site "collapsed" in about 2 minutes. The query that is used to select loan types sometimes hangs for ~10 seconds and it happens frequently and thus it cant keep up and its hella slow. The table that is used to store the data has approximately 2 milion records and each select looks like this: SELECT * FROM products_loans WHERE KOD IN("X17/Q30-10", "X17/12", "X17/5-24") AND 369.27 BETWEEN CENA_OD AND CENA_DO; 3 loan types and the price that needs to be in range between CENA_OD and CENA_DO, thus 3 rows are returned. But since I need to display 10 products per page, I need to run it trough a modified select using OR, since I didnt find any other solution to this. I have asked about it here, but got no answer. As mentioned in the referencing post, this has to be done separately since there is no column that could be used in a join (except of course price and code, but that ended very, very badly). Here is the show create table, kod and CENA_OD/CENA_DO very indexed via INDEX. CREATE TABLE `products_loans` ( `KOEF_ID` bigint(20) NOT NULL, `KOD` varchar(30) NOT NULL, `AKONTACIA` int(11) NOT NULL, `POCET_SPLATOK` int(11) NOT NULL, `koeficient` decimal(10,2) NOT NULL default '0.00', `CENA_OD` decimal(10,2) default NULL, `CENA_DO` decimal(10,2) default NULL, `PREDAJNA_CENA` decimal(10,2) default NULL, `AKONTACIA_SUMA` decimal(10,2) default NULL, `TYP_VYHODY` varchar(4) default NULL, `stage` smallint(6) NOT NULL default '1', PRIMARY KEY (`KOEF_ID`), KEY `CENA_OD` (`CENA_OD`), KEY `CENA_DO` (`CENA_DO`), KEY `KOD` (`KOD`), KEY `stage` (`stage`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 And also selecting all loan types and later filtering them trough php doesnt work good, since each type has over 50k records and the select takes too much time as well... Any ides about improving the speed are appreciated. Edit: Here is the explain +----+-------------+----------------+-------+---------------------+------+---------+------+--------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------------+-------+---------------------+------+---------+------+--------+-------------+ | 1 | SIMPLE | products_loans | range | CENA_OD,CENA_DO,KOD | KOD | 92 | NULL | 190158 | Using where | +----+-------------+----------------+-------+---------------------+------+---------+------+--------+-------------+ I have tried the combined index and it improved the performance on the test server from 0.44 sec to 0.06 sec, I cant access the production server from home though, so I will have to try it tomorrow.

    Read the article

  • PHP mysql multi-table search returning different table and field data row after row

    - by Kinyanjui Kamau
    Hi Guys, I am building a social networking site that is dedicated to nightclubs and night events. Among other tables, I have a users table, events table and establishments table. I am really intrigued with how Facebook in particular is able to query and return matches of not just users but also pages, ads etc row after row. Im sure most who are reading this have tried the facebook search My question is in my case, should I: Perform 3 separate LIKE %search% on each of the tables on search.php. Draw up 3 separate tables to show the results of what matches in the relevant queries which are collapsed when empty(on the same search.php) ie In search.php //query users table $query_user = "SELECT user_first_name, user_last_name, username, picture_thumb_url, avatar FROM users JOIN picture ON users.user_id = picture.user_id AND picture.avatar=1 ORDER BY users.user_id"; $result_users = mysql_query($query_user, $connections) or die(mysql_error()); $row_result_users = mysql_fetch_assoc($wid_updates); //query events table $query_event = "SELECT event_thumb_url, event_name, event_venue, event_date FROM event WHERE event_name LIKE '%".$search_value."%'"; $event = mysql_query($query_event, $connections) or die(mysql_error()); $row_event = mysql_fetch_assoc($event); $totalRows_event = mysql_num_rows($event); //query establishments table $query_establishment = "SELECT establishment_thumb_url, establishment_name, location_id, establishment_pricing FROM establishment WHERE establishment_name LIKE '%".$search_value."%'"; $establishment = mysql_query($query_establishment, $connections) or die(mysql_error()); $row_establishment = mysql_fetch_assoc($establishment); $totalRows_establishment = mysql_num_rows($establishment); My html: <table max-width="500" name="users" border="0"> <tr> <td width="50" height="50"></td> <td width="150"></td> <td width="150"></td> <td width="150"></td> </tr> </table> <table width="500" name="events" border="0"> <tr> <td width="50" height="50"><a href="#profile.php"><img src="Images/<?php echo $row_event['event_thumb_url']; ?>" border="0" height="50" width="50"/></a></td> <td width="150"><?php echo $row_event['event_name']; ?></td> <td width="150"><?php echo $row_event['event_venue']; ?></td> <td width="150"><?php echo $row_event['event_date']; ?></td> </tr> </table> <table width="500" name="establishments" border="0"> <tr> <td width="50" height="50"><a href="#profile.php"><img src="Establishment_Images/<?php echo $row_establishment['establishment_thumb_url']; ?>" border="0" height="50" width="50"/></a></td> <td width="150"><?php echo $row_establishment['establishment_name']; ?></td> <td width="150"><?php echo $row_establishment['location_id']; ?></td> <td width="150"><?php echo $row_establishment['establishment_pricing']; ?></td> </tr> </table> I haven't populated the PHP echo's for the user table. This is just to give you an idea of what I am trying to do. Any assistance?

    Read the article

  • Select options not showing in IE

    - by donkapone
    I have a dynamically generated select with some options and it shows the options fine in normal browsers, but its empty options in IE. Here's the generated HTML: <select name="0" id="custom_0" style="border-bottom: #c0cedb 1px solid; border-left: #c0cedb 1px solid; background-color: #ededed; width: 280px; font-size: 0.87em; border-top: #c0cedb 1px solid; border-right: #c0cedb 1px solid"> <option id="1000" value="0" name="00">1x2GB ECC DDRIII 2GB ECC DDRIII</option> <option id="1001" value="10" name="01">2x2GB ECC DDRIII 4GB ECC DDRIII (+10.00 €)</option> </select> I can't really show you the javascript, since there's so much of it and I would be able to make it simple just for a demo. Maybe you had some of you would've had a similar experience and could figure this one out. Thanks I've added some javascript: $('#custom_order').append('<tr id="custom_'+category+'_row"><td'+padding+'>'+header+'<select id="custom_'+category+'" name="'+category+'" style="background-color:#EDEDED;border:1px solid #C0CEDB;width:280px;font-size:0.87em"></select>'+plusspan+'</td></tr>'); for (var i=0;i<components[category]['value'].length;i++){ $('#custom_'+category).append('<option id="'+components[category]['value'][i]['id']+'" value="'+components[category]['value'][i]['price']+'"></option>'); removals(category,i); dependencies(category,i); selectInput(category); } getDiff(category); getDiff() function adds the values to the options with html() function. The weird thing is, if I alert the html of the option just after the getDiff() function, it shows the value filled out. And it I put the getDiff() function in the for loop where the options are generated, it fills the values and shows them in IE, just not the last one. I'm calling getDiff() outside the loop for optimization, and since I can add the values later after all the options are generated. Well at least I thought I could, since it works on Firefox and Chrome.

    Read the article

  • Mysql select most frequent and sort alphabetically

    - by user2605793
    I am trying to select the most common 100 names from a table then display the list showing the names and count. I want the user to be able to re-sort the list alphabetically rather than based on count. I thought the following code would do it. It works for the default sort by count but fails on the sort alphabetically. The line "$count = mysql_num_rows($table);" gives an error: mysql_num_rows() expects parameter 1 to be resource, boolean given. Any help would be greatly appreciated. // Get most popular surnames echo '<h2>Most Common Surnames</h2>'; if ($sort == "") { // default sort by count echo '<a href="http://mysite/names.php?id='.$id.'&sort=name">Sort by name</a><br>'; $query = "SELECT family_name, COUNT(*) as count FROM namefile WHERE record_key = $id GROUP BY family_name ORDER BY count DESC LIMIT 100"; } else { // sort alphabetically echo '<a href="http://mysite/names.php?id='.$id.'">Sort by count</a><br>'; $query = "SELECT * FROM ( SELECT family_name, COUNT(*) as count FROM namefile WHERE record_key = $id GROUP BY family_name ORDER BY count DESC LIMIT 100) AS alpha ORDER BY family_name"; } $table = mysql_query($query); $count = mysql_num_rows($table); $tot = 0; $i = 0; echo '<table><tr>'; while ($tot < $count2) { $rec2 = mysql_fetch_array($table2); echo '<td>'.$rec2[0].'</td><td>'.$rec2[1].'</td><td width="40">&nbsp;</td><td>'; if ($i++ == 6) { echo '</tr><tr>'; $i = 0; } $tot++; } echo '</tr></table><br>'; UPDATE: I needed to add "AS alpha" to give the outer select a unique name. (alpha is just a random name I made up.) It now works perfectly. Code updated for the benefit of any others who need something similar.

    Read the article

  • How to get the selected option value of a drop down box in PHP code

    - by Angeline Aarthi
    I have a dropdown box which lists a set of logos,like flower,butterfly etc. <p class="title1">Logo</p> <select name="logoMenu" class="select" size="7"> <?php foreach($logos as $logo):?> <option id="<?php echo $logo['Subproperty']['id'];?>" value="<?php echo $logo['Subproperty']['values'];?>"><?php echo $logo['Subproperty']['values'];?> </option> <?php endforeach;?> </select> Suppose If I select the logo 'Flower' from the drop down box, I want the flower pic to be displayed in a div.This is the div that I have to display the pictures. <div id="theme_logos" class="float_left spaceleft" style="display:none;"> <?php foreach($defaultLogos as $logo): //if($logo['Subproperty']['values']==clicked option value){?> <img height="50" width="50" src="/FormBuilder/app/webroot/img/themes/<?php echo $logo['Subproperty']['images'];?>" class="float_left user_profile_image user_profile_image" alt="Default50"/> <?php endforeach;?> </div> The problem with this code is that it displaya all the pictures found in the table. Because im My controller code, I give only the property id as that of 'Logo',but do not give which logo. $this->set('defaultLogos',$this->Subproperty->find('all',array('conditions'=>array('Subproperty.property_id'=>1,'Subproperty.values'=>"Flower")))); Here I have hard coded as 'flower' so that I get the flower picture alone.. If I select the logo from the drop down box, how to pass that selected value to the controller code? Or if I get the selected logo name thro' jquery,how to use that value in the if condition inside the for each loop? someone help me out with this.. I'm using CakePHP framework. $("#logoMenu option").click(function(){ selectedLogo=$(this).attr("value"); $('#subproperty_id').val($(this).attr("id")); if(selectedLogo=="Your logo"){ $("#themes_upload").show(); } else{ alert(selectedLogo); $("#themes_upload").hide(); $("#theme_logos").show(); } }); EDIT Now I have tried an ajax post where I pass the selected logo to the same action of the controller. I get the value when I alert the passed value in the success function of the ajax function. I the picture doesn't appear. $("#logoMenu option").click(function(){ selectedLogo=$(this).attr("value"); $('#subproperty_id').val($(this).attr("id")); if(selectedLogo=="Your logo"){ $("#themes_upload").show(); } else{ alert(selectedLogo); $.ajax({ type: "POST", url: "http://localhost/FormBuilder/index.php/themes/themes/", async: false, data: "selectedLogo="+selectedLogo, success: function(msg){ alert( "Data Saved: " + msg); } }); $("#themes_upload").hide(); $("#theme_logos").show(); } }); function themes(){ $this->set('themes',$this->Theme->find('all')); $logo=$this->params['form']['selectedLogo']; echo "logo:".$logo; $this->set('defaultLogos',$this->Subproperty->find('all',array('conditions'=>array('Subproperty.property_id'=>1,'Subproperty.values'=>$logo)))); } But when I trry to display the img in the page,it doesn't appear. Is it because the div show command is after the ajax request?

    Read the article

  • DataView.RowFilter Vs DataTable.Select() vs DataTable.Rows.Find()

    - by Aseem Gautam
    Considering the code below: Dataview someView = new DataView(sometable) someView.RowFilter = someFilter; if(someView.count > 0) { …. } Quite a number of articles which say Datatable.Select() is better than using DataViews, but these are prior to VS2008. Solved: The Mystery of DataView's Poor Performance with Large Recordsets Array of DataRecord vs. DataView: A Dramatic Difference in Performance Googling on this topic I found some articles/forum topics which mention Datatable.Select() itself is quite buggy(not sure on this) and underperforms in various scenarios. On this(Best Practices ADO.NET) topic on msdn it is suggested that if there is primary key defined on a datatable the findrows() or find() methods should be used insted of Datatable.Select(). This article here (.NET 1.1) benchmarks all the three approaches plus a couple more. But this is for version 1.1 so not sure if these are valid still now. Accroding to this DataRowCollection.Find() outperforms all approaches and Datatable.Select() outperforms DataView.RowFilter. So I am quite confused on what might be the best approach on finding rows in a datatable. Or there is no single good way to do this, multiple solutions exist depending upon the scenario?

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >