Posts

Showing posts from July, 2014

sql - How to store multiple values from select subquery -

hi having problem in following query: update tbl set somecol = somecol key = (select key tbl group key having count(*) > 1) , time = (select max(time) tbl) above query works fine when there 1 key. if there more 1 keys query doesn't work. how store multiple values select subquery? time column can multiple. new sql. please guide. in advance. use in predicate: update tbl set somecol = somecol key in (select key tbl group key having count(*) > 1) , time = (select max(time) tbl)

Android "wrong password or username " message box display error -

i working on activity has username , password. used alertdialog.builder in else part show message of "wrong password or username". not connecting database test purpose using strings password , username compare values of edittext fields with, in if condition , if match takes user new screen name "newmenu" . problem when login activity starts (the app runs), shows first of message, else part, want show message after submit button has been clicked , the password or username wrong. here code public class login extends activity{ private string pass=new string(); private string nam=new string(); private button log; private view textreg; private edittext text1; private edittext text2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.login); textreg=(textview) findviewbyid(r.id.textregister); log=(button) findviewbyid(r.id.btn

Having issues autowiring a sessionfactory bean with spring mvc and hibernate -

i trying implement auto-wiring project, seems application isn't seeing sessionfactory definition in application-context.xml when running it. i'm missing obvious, though i've tried several solutions posts having similar issues no success. i using spring mvc , hibernate. here application-context.xml. <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop

ios - Reposition swipe-to-delete button in tableview -

i have tableview custom-designed cells , if add swipe-to-delete buttons layout horrible. possible reposition these buttons inside cell? no not possible made changes delete button because built-in or default functionality of apple ios. better stop fighting :)

sql - Find the last entry for specific user id -

i trying find last entry specific user each location . need ignore rows balance zero. sample table: id location user balance -- -------- ---- ------- 1 gla 10.21 2 gla 0.00 3 gla b 45.68 4 gla b 12.56 5 edi c 1.23 6 edi d 5.48 7 edi d 0.00 8 lon e 78.59 9 man f 0.00 10 man f 12.98 11 man g 56.45 12 man g 89.25 13 man h 0.00 14 bir 0.00 15 bir 32.87 result required: id location user balance -- -------- ---- ------- 4 gla b 12.56 5 edi c 1.23 8 lon e 78.59 10 man f 12.98 12 man g 89.25 15 bir 32.87 i have been left cover colleague off sick , unfotunately sql knowledge limited in comparison. i have been researching using max , partition no luck far. sql server 2005 database. any assistance appr

osx - How to get Mail.app raw message in the Automator? -

Image
need raw message content os x mail.app pass next action. unfortunately - tested - , doesn't works: :( i don't want select "content" of message, want pass raw content (what base64 encoded) next action. so, need applescript action betwwen "get selected mail messages" , "new document". haven't idea how this... the "new textedit doc" tests, real action perl script, read raw message content stdin . try: on run {input, parameters} set thesource {} tell application "mail" repeat amessage in input set end of thesource amessage's source & return end repeat end tell return thesource text end run

java - Jenkins Matrix Project: Ignore non existing configurations -

we use 3-4 axis's in our matrix projects (os, isa, compiler , more) , annoyed fact have manually write complex combination filters because configurations don't exist. is there way tell jenkins ignore non existing configurations instead of piling them in queue?

textmate - Bundle items fail after having previously worked -

depending on bundle item exact error failing textmate2 bundle can change, 1 getting "comment line / selection" on pristine textmate2 comment line / selection:16:in 'require': no such file load -- /lib/escape (loaderror) comment line / selection:16 how fix bundles? first try this: delete file: ~/library/caches/com.macromates.textmate/bundlesindex.plist relaunch textmate. problem cache not updating when bundles changed on disk (as have been recently, lot of bundles got updated) — far though know happens, not why happens…' source: textmate email list then, if doesn't work, try this: textmate -> preferences -> bundles , uninstall , reinstall "bundle support" quit , relaunch textmate.

Using Word OLE in Lazarus FreePascal -

im trying freepascal open word document, append text , data , close it. i've managed connected , can write single line document on defeating me. attempting methods details in this visual basic reference , pretty similar how expect freepascal handle things. basically think have misunderstood how relationship between lazarus , word ole works, can offer me examples on how construct simple document can build on? the following code, opens document replaces contents program officauto; {$ifdef fpc} {$mode delphi} {$else} {$apptype console} {$endif} uses sysutils, variants, comobj; const servername = 'word.application'; var server, doc : variant; opara : variant; w:widestring; begin if assigned(initproc) tprocedure(initproc); try server := createoleobject(servername); except writeln('unable start word.'); exit; end; w:= utf8decode('c:\mydoc.docx'); server.visible := true; {make word visible} doc := server.docum

javascript - How to append a attribute to already existing JSON using node js -

i have json follows: { "elements": [ { "name": "f975cfaf-8fb4-2926-dd56-74cd230d15af", "uri": "vm/hpcloud/nova/large", "parameters": { "imageuri": "image/hpcloud/nova/ami-00001b03", "securitygroups": [ "default" ] }, "metadata": { "name": "hpcloud large vm ubuntu 10.04 bitnami webpack 1.2-0 nova", "description": "hpcloud large vm ubuntu 10.04 bitnami webpack 1.2-0 nova" } } ] } i need manipulate attribute "metadata" follows (note new attribute appended) : { "elements": [ { "name": "f975cfaf-8fb4-2926-dd56-74cd230d15af", "uri": "vm/hpcloud/nova/large", "parameters": { "imageuri&q

sockets - Injecting raw packet onto network in C (Linux) -

i trying write function takes stream of bytes (including ethernet header , perhaps upper layer protocols encapsulated within ethernet packet well) , send out on network on particular interface. here summary of code: // create socket int s = socket(pf_packet, sock_raw, htons(eth_p_all)); if (s < 0) { // error handling } // set receive/send packets on 1 interface (stored in variable iface_name e.g. eth0) struct ifreq ifr; bzero(&ifr, sizeof(struct ifreq)); strncpy(ifr.ifr_ifrn.ifrn_name, iface_name, ifnamsiz); if (ioctl(s, siocgifindex, &ifr) < 0) { // error handling } // set socaddr write struct sockaddr sa; sa.sa_family = pf_packet; sa.sa_data = htons(eth_p_all); // write wire // buf has type char* , len has type int // buf contains ethernet header, followed payload (e.g. arp packet or ip packet) if ( sendto(s, buf, len, 0, &sa, sizeof(struct sockaddr) ) < 0 ) { perror("sendto"); // more error handling } i error sendto: inva

c# - Too much recursion from one out of two links calling the same function -

to start read alot of threads problem , solved myself before. matter leaves me confused.. code <leads:leadslisting runat="server" id="myleadslist" list="myleads"/> <leads:leadslisting runat="server" id="newleadslist" list="unassigned" /> both fetches same gridview, have filters being applied them (which work fine) this script being called on page_load scriptmanager.registerstartupscript( detailsupdatepanel, detailsupdatepanel.gettype() "clickabletrs", "$('#" + leadsgridview.clientid + "table tr td:first-child a').each(function(){ var func = function('event', this.href.substring(\"javascript:\".length) +'; if(event.stoppropagation){event.stoppropagation(); } else{ event.cancelbubble = true; }'); this.href = '#'; $(this).click(func); }); $(&

javascript - Unable to verify form has been filled out with CasperJS & jQuery -

i have got form trying fill using casperjs. code doesn't appear have problems (no errors being returned) - seem unable 'check' form has been filled out. when dump 'first_name' appears blank - though have set filled string 'joe' - ideas doing wrong? casper.start(url); casper.then(function() { this.fill('form[name="phones_display"]', { 'first_name' : 'joe', // required 'last_name' : 'bloggs', // required 'check_payable' : '', // name cheque if different name 'payment_method' : 'check', // required check, paypal 'shipping_method' : '', // envelope, fedex 'email_address' : 'joe@bloggs.com', // required 'paypal_email_address' : '', 'telephone_number' : '12345678', // required '

node.js - possible EventEmitter memory leak detected - nodejs v.0.10.4 - on centos -

i'm trying create simple static file server node.js, namely serve videos video/mp4 (content-type), download via http. to note, files large (more 100mb) tried using package node-serve recommended static file serving not serve purpose (and looks using blocking reads). my custom code work, yet i'm getting memory leak each request, after 10-20 requests crashes process following error: fatal error: call_and_retry_2 allocation failed - process out of memory each refresh increasing node.js's memory footprint around 200mb. looked @ of answers here memory leaks node.js, none of answers solve issue, seems platform specific or combination... , not strictly code fault, have noted developers experience issue since version 0.6+ of node.js... also saw posts claim happens express ( https://npmjs.org/package/express ) the code used: var fs = require('fs'); var http = require('http'); var mediapath = '/mypublicdir'; function error404(res) { r

windows 7 - Microsoft.ACE.OLEDB.12.0 installed but not appearing as a Provider for SQL 2008R2 -

i've installed microsoft.ace.oledb.12.0 on windows7 machine doesn't appear under providers in relevant bit of registry (hklm/software/microsoft/microsoft sql server/mssql10_50.mssqlserver/providers) and, presumably because of this, doesn't appear in list of providers in linked servers section of sqlserver management studio. the problem i'm having i'm trying run openrowset query against excel spreadsheet. this after migrated web application/database xp new windows 7 installation. needless fine on xp box.

excel - Vlookup macro doesn't return all values needed but the values are input to pull from -

i'm getting stumped, vlookup messed , i've tried change values in column text , values general. here code, can vlookups seperately need them 1 after , when first vlookup formula comes #n/a or #name or #value need 2nd vlookup formula come through , fill fields appropraitely, suggestions, i've tried many different variations. here have error says expected list seperator or (, if take of iferror , 2nd function number values work because brand names can determined serial numbers 4th , 5th digit, serials have letters in place , whole issue, have letter , dash, a- example, need able vlookup of these types not replace fields have accurate values, first vlookup replaces 2nd comes in fill errored fiels. appreciated. this code reproduces errors. sub work2() dim lr long dim row string row = "w2" row = "w" & x lr = range("w" & rows.count).end(xlup).row range(columns(6), columns(7)).select x = 0 2 row = "w" & x range("a2:a

Is it safe to use :after-selector with jquery= -

this question has answer here: only detect click event on pseudo-element 7 answers i want trigger function when clicking :after for example .foo:after{ content: "read more"; } $('foo:after').click(myfunction); will cause fuzz? you cannot detect or trigger events on pseudo-elements not part of document object model . also see only detect click event on pseudo-element

Rails / Devise custom error messages for sign in -

i have website uses devise authentication. i want show different error messages users different cases: email & password don't match email not found in database can me understand devise methods should override, , how?

powershell - How to use the Copy-Item cmdlet correctly? -

i building small script should copy .zip files special folder called f:\tempzip . i tried copy-item cmdlet, didn't manage it. script should copy files folder (recursively) ".zip". this part of script talking about: get-childitem f:\work\xxx\xxx\xxx -recurse | {$_.extension -eq ".zip"} | copy-item f:\tempzip what have add? when piping items copy-item need tell "f:\tempzip" destination path. | copy-item -destination f:\tempzip you can cutout piping where operator using get-childitem 's parameter -filter . get-childitem "c:\imscript" -recurse -filter "*.zip" | copy-item -destination "f:\tempzip" edit : removal of unnecessary foreach loop , updated explanation.

forms - Transfer value to other page using PHP session - textarea -

transfer value page successful, have read many topics on subject, stockoverflow helped me this. on first page (eg page1.php) have input. type value it. with php write in session variable , after clicking submit can transfer value other side (eg page2.php) simple contact page. value pasted textarea field. my problem takes value type directly input, located in page1.php. wanted create rather calculator, consist of price according entered number of kilograms of product. (the kilogram value entered in input). how form field clean, , order product redirected correctly? my code in page1.php : <?php session_start(); $_session['towar1'] = $cena1; ?> <form method="get" action="kontakt.php"> <input id="wart1" type="number" value="0" name="towar1" class="ilosc" required> </form> my code in page2.php(conttact page) : <?php session_start(); $cena1 = $_get['towar1'];

MySQL: Issue joining two tables -

so i'm trying select 5 random rows category_event table, match fk_event_id category_event table id events table, , order 5 random rows start_time events table. i have 25 rows in category_event table fk_category_id=2, when run query returns 5 rows, next time 4 rows, next time 5 rows, next time 3 rows, etc. should 5 every time... this have: select * ( select fk_event_id category_event fk_category_id=2 , status = 'enabled' order rand() limit 5 ) c inner join events e on e.id = c.fk_event_id order e.start_time; any appreciated :) turns out had rows in category_event had fk_event_id's pointing non existing rows in events. everything's :)

python - Get text from <a> element? -

i school name, "perkins college..." link using beautifulsoup. the code use returns nothing. school = soup.find('a','profiles-show-school-name-sm-link') print 'school: ', school print 'school.text: ', school.text output: school: <a class="profiles-show-school-name-sm-link" href="/profiles/show/online-degrees/stephen-f-austin-state-university/perkins-college-of-education-undergraduate/395/5401"> <img border="0" src="/images/profiles/243x60/4613/degrees/undergraduate-certificate-in-hospitality-administration.png"/> </a> school.text: suggestions beautifulsoup implementation extract school name (not url)? thx! school = soup.find('a','profiles-show-school-name-sm-link') url = school['href'] assuming school in same spot in url: for in range(5): url = url[url.find("/")+1:] schoolname = url[:url.find("/")] print "

jquery - Javascript doesn't work in first load -

i'm use jquery ui datepicker , have problem. datepicker don't work in first load. searched , try substitute document.ready windows.load, don't work :/ code is: $(window).load(function() { alert('carregado!') $('.datepicker').datepicker({ format: 'dd/mm/yyyy', language: 'pt-br', autoclose: true}); $('#status_bar').barrating( { onselect: function(value, text) { $('#projeto_status').val(value); } }); }); i see others answers, no 1 work me. observation, project in rails 4, , use turbolinks yes! thanks! got it! i chance function, look: var do_on_load = function(){ alert('carregado!') $('.datepicker').datepicker({ format: 'dd/mm/yyyy', language: 'pt-br', autoclose: true}); $('#status_bar').barrating( { onselect: function(value, text) { $('#projeto_status').val(value); } }); } $(document).ready(do_on_load) $(window

php - codeigniter CMS form validation -

firstly im new codeigniter , mvc. i creating cms , coudln't decide route take have 2 applications (front end/cms) or create admin controller. opted 1 application , creating admin via controller. doing way have ran problem form validation if doesn't validate cant load form have redirect means wont repopulate unvalidated fields. use variable in 3rd uri segment determine whether display form inserting new record, populated form editing record, or tabled list of records. the form posts /admin/videos/save function videos() { if (!$this->tank_auth->is_logged_in()) { redirect('/auth/login/'); } else { $this->load->model('videos_model'); $data['section'] = "videos"; $data['area'] = "videos"; $data['mode'] = $this->uri->segment(3, 'create'); $data['user_id'] = $this->tank_auth->get_user_id(); $data['u

javascript - Is it possible to clone one div to another page? -

i have page called riskscore.cshtml , in there have 1 dynamically created div-tag span-tags. want have same div-tag same span-tags in on next page called overview.cshtml. trying use jquery this: function copydiv() { $('.headdiv').clone().appendto('.topinfo'); } but won't work. there way it? or use wrong syntax?

synchronization - Permission to synchronize hybris product -

Image
how enable hybris user group synchronize individual products on hmc? more specifically, want enable button "start synchronization product" on hmc users of user group: preferably, if show me how grant these access rights via impex files. try granting these user group enable button: type;uid;memberofgroups;password;target;read;change;create;remove;change_perm usergroup;mygroup;employeegroup;;;;;;; ;;;;syncitemcronjob;+;+;+;+ ;;;;synchronizecatalogversionwizard;+;+;+;+ if don't want allow entire catalog synchronization group, can disable hmc node adding hmcxml user group, this: insert_update usergroup;uid[unique=true];hmcxml ;mygroup;"<?xml version=""1.0"" encoding=""iso-8859-1""?> <configuration xmlns=""hybris.de/schemas/hmc/generic"" xmlns:xsi=""http://www.w3.org/2001/xmlschema-instance"" xsi:schemalocation=""hybris.de/schemas/hmc/generic

objective c - NSComboBox - problems with background when selected -

Image
i'm ios developer, , i'm programming desktop app mac osx. still don't have experience view's components of osx, maybe it's silly or easy question, have made little research problem , haven't found solution yet. here's problem: i have custom specialization of nsview, used view of content viewcontroller used in nspopover. inside view, i'm calling "popoverbackgroundview", painted inside drawrect red background, , calculated minor rect , painted gray-like color. here's code: - (void)drawrect:(nsrect)dirtyrect { [[nscolor colorwithdevicered:174/255.0 green:72/255.0 blue:72/255.0 alpha:1.0] setfill]; nsrectfill(dirtyrect); [[nscolor colorwithdevicered:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0] setfill]; nsrectfill(nsmakerect(border_width, border_width, dirtyrect.size.width - 2*border_width, dirtyrect.size.height - 2*border_width)); } so, inside popoverbackgroundview.m i'm programatically creating nscombob

jQuery FAQ autosuggest answer below title as per StackOverflow -

i want have support form use content of 'problem title' field trigger add div below possible answers stackoverflow when submit new question. to clarify, not want suggested answers presented 'auto-complete' option, want them appear below suggested answer. the markup in page might like: <input type="text" value="" placeholder="your problem in brief"> <div id="possibleanswers" class="hidden"> <ul> <li><a href="#">possible answer 1</a></li> <li><a href="#">possible answer 2</a></li> <li><a href="#">possible answer 3</a></li> </ul> </div> as user starts type summary of problem div below populate suggested answers. i managed , running, here's ended with: var do_live_search = function() { var stopwords = new array("a","about","

java - How to access AbstractButton's method from anonymous inner class? -

here class: public class buttonpanel extends jpanel { public buttonpanel () { makebutton ("button1"); makebutton ("button2"); makebutton ("button3"); } void makebutton (string name) { jbutton button =new jbutton(name); add(button); button.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { settext("i clicked"); } }); } } when button clicked, text should change "i clicked". however, don't know how access settext method. tried button.settext("i clicked") not possible. by making reference of jbutton final, : void makebutton(string name) { final jbutton button =new jbutton(name); add(button); button.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { button.settext("i clicked&q

css - Display first letter only for glyph fonts (accesible way) -

Image
i have glyph font , want use achieve effect: my code far: <div class="ico linkedin">linkedin</div> .ico {border-radius:10em; background:black; color:white} .linkedin {visibility:hidden;} .linkedin:first-letter { font-family:'justvector'; font-size:900%; text-indent:1em; visibility:visible } this trick in chrome, not in ff or ie(9). also, isn't accesible, because jaws doesn't read hidden or display:none elements. so, tried like: .linkedin {position:absolute; left:-5em} .linkedin:first-letter {/*etc*/ position:absolute; left:6em} but doesn't work. there proper , accesible way achieve this? the accessible way use icons use img elements adequate alt attributes, e.g. <img src=smiley.gif alt="just joking!"> icon fonts (which mean “gliph font”) have inherent accessibility problems. using e.g. letters , trying fool browsers rendering them icons css means css turned off, there lett

Using of session in Ruby on Rails -

i have understood use of session using hash (more or less). when use session set session[:sort] = 'title'. however, app throws me exception: undefined local variable or method `session' moviescontroller:class that makes me think have set before use session, initialize it. ideas? thanks! are using session in class method? need use in instance method.

Change screens on Android app -

what best way switch screens on android app, have main activity page 4 buttons, first 2 go websites , want too, , other 2 buttons go other app pages have built. i have new pages in /layout/activity_two.xml desired: click "button3" on main page, screen switches new page thanks help the best way switch 'screens' (which called 'views', , refer rectangular area of screen, may or may not entire screen) use fragments (which contain views cover whole screen). when using fragments, can have 1 main activity switches between various fragments. here little spiel android developer website: http://developer.android.com/training/basics/fragments/index.html i found helpful, , example kind similar trying accomplish (minus web pages): http://www.youtube.com/watch?v=kyxvq_kwfzg

file io - C style regarding fprintf -

if program has many lines of code print string file, of following preferred? how important use preferred format? fprintf(file, "%s", "string file"); fprintf(file, "string file"); fprintf(file, "%s", "string file"); fprintf(file, "string file"); if string printed variable in way former version preferred one, if strings constants, hard coded, save use latter. the danger using latter version variable strings evil mind enter conversion specifiers ( %d , %s , ...) string make code pull stack not meant pulled. leads mayor security issues.

c# - Set focus to child in web user control -

i've created web user control phone number entry has 3 text boxes area-code, number, , extension. text boxes in table positioning , table inside span. in page uses control have <asp:label id="label6" runat="server" associatedcontrolid="uxphonenumber">phone</asp:label> what want set focus area-code input when associated label clicked on. web user control focus when label clicked, or can change html in ascx works? have tried adding onfocus() <span> tag, , <table> tag can use javascript set focus, event not raised. if move onfocus() event first input fires , script runs here complete ascx code. <%@ control language="c#" autoeventwireup="true" codebehind="phonenumber.ascx.cs" inherits="customcontrols.phonenumber" %> <span id="uxphonenumbercontrol" runat="server" style="display: inline-block;" onfocus="setinitialfocus()"> <

javascript - Data transition = Slide not working -dynamic list -

i new jquery mobile. i trying sliding effect when navigate page # display2 thie below code. but not able slide effect. if remove rel="external" able slide on #display2(page whihc navigate to),the query string values returned null. so if put rel="external" parameters passed #display2 slide transition not working. if remove re="external" slide works querystring parameters returned null. can please let me know there way both of them work together. ('#display').on('pagebeforeshow', function () { // $(this).find('[data-role=header] .ui-title').text(json.getlobxmlresult[currentitem].foldername); $.ajax("appstorews.svc/getlobxml", { beforesend: function (xhr) { $.mobile.showpageloadingmsg(); }, complete: function () { $.mobile.hidepageloadingmsg(); }, contenttype: '

c# - System.ComponentModel.Win32Exception (0x80004005): Server RPC unavailable -

sorry duplicate, have situation. have little program realize printpreview , print processes. private void printdocument1_printpage(object sender, system.drawing.printing.printpageeventargs e) { e.graphics.drawstring("hello world", new font("times new roman", 16, fontstyle.bold), brushes.black, 10, 10); } private void button1_click(object sender, eventargs e) { string str = ""; (int = 0; < printersettings.installedprinters.count; i++) { str += printersettings.installedprinters[i] + "\n"; } messagebox.show(str); try { printpreviewdialog1.document = printdocument1; printersettings prnset = new printersettings(); if (printersettings.installedprinters.count > 0) { pagesettings ps = new pagesettings(prnset); ps.margins.left = 10; ps.margins.right = 20; ps.margins.top

c# - Trying to update the list of an entity -

so setup following: supportticket - contains list of supportticketmessags called messages. supportticketmessage - contains userprofile , message i'm trying add supportticketmessage list of existing supportticket following method: public void addreply(string message, userprofile author) { using (contextdb db = new contextdb()) { supportticketmessage msg = new supportticketmessage(author, message); messages.add(msg); db.userprofiles.attach(owner); db.entry(this).state = entitystate.modified; db.savechanges(); } } however whenever attempt following error: an object same key exists in objectstatemanager. objectstatemanager cannot track multiple objects same key. at following line: db.entry(this).state = entitystate.modified; to sum up: i'm adding object list , object saved database. how can this? you don't have explicitly change state of object. entity framework automatically.

sql server - display multiple output parameters in T-SQL stored procedure -

i want display 2 tables of 1 column each output in stored procedure defined create procedure p1 @name varchar(20) output, @company varchar(20) output begin select @name = t1.name table1 t1; select @company = t2.company table2; end executed declare @name varchar(20), @company varchar(20) exec dbo.p1 @name = @name, @company = @company select @name 'name', @company 'company' however, displays single row . doing wrong? if want display values 1 column, 2 rows - use union: select @name 'name' union select @company note both values display under same column name 'name' if want display strings 'name' , 'company' have assure order of rows column: select 'name' info, 0 sort union select @name, 1 union select 'company', 2 union select @company, 3 order sort