Programming :: Change A Mysql Query Result Prior To Display?

Oct 17, 2010

I am not sure if this is possible. I have IP's stored in a mysql database. When I query the database, it returns the IP. I would like to replace the IP with something else prior to displaying the results. Is it possible even though I have not stored it in the database?

I have the following in a while loop (mysql_fetch_array).

Code:
<td align="left">' . $row[IP] . '</td>

Instead of displaying $row[IP] from the database, I would like it to display something else which I define in the PHP code but based on the IP.

ie. aaa.bbb.ccc.ddd = hostnameABC

View 4 Replies


ADVERTISEMENT

Programming :: PHP / MySQL Statement - Query Result

Jan 29, 2011

It is under PHP/MySQL
$queryresult = $conn->query("INSERT INTO normalrequests VALUES($finalkey, 1234, 5678, FALSE)");
It is connected to the database successfully but I feel there is something wrong with the statement up there.

View 6 Replies View Related

Programming :: PHP & MySQL - Query A Database From The Web?

Apr 26, 2010

I have created a database which stores students grades for different stages of a project. One of the stages of the project is the specification part. I have a simple bit of html code which is going to be used as the searching facility. I want the user to be able to enter their ID and then it will display only their results. At the moment, it is displaying the results for EVERY student because I cant seem to find the correct syntax for my statement.

Heres the HTML code

<html>
<head>
</head>
<body>
<body bgcolor="#6881bb">
<center>

[Code]....

At the moment when i click the button, no matter what I enter every students marks appear on the screen.

I think, but obviously dont know for sure because if i did i would know how to solve the problem, the code that i need to change is in green.

View 3 Replies View Related

Programming :: Insert Query In Mysql ?

Jul 12, 2011

When i enter this query to mysql:

Code:

return this error:

Code:

when i delete the insert part :

Code:

query is ok:

Code:

1 row in set (0.00 sec)

View 2 Replies View Related

Programming :: Duplicate Value In Select - Mysql Query ?

Dec 2, 2010

Trying to export a Mysql query to a .csv file the query draws from multiple tables, e.g. sales, purchase and currency

Code:

What i'm trying to do is to export both the sales and purchase to a single line where both the currency for the sales and the purchase is specified.

Basically like this:

Code:

Problem here is that i'm stating currency.value twice in the same select and don't know how to define which currency.value applies to sales and which to purchase.

View 7 Replies View Related

Programming :: Send A Mysql Query Output Into An Array?

Jul 27, 2010

i will be quick, im trying to send a mysql query output into an array ie:

Code:
declare -a HD
HD=`echo "USE db; SELECT uid FROM user" | mysql -u $login -p$pwd -h $dbhost -B`
echo ${#HD}
those vars in mysql connection are previously and correctly assigned.
but got an error

script.sh: 2: declare: not found

View 3 Replies View Related

Programming :: Looping Over Mysql Query Results In Bash?

Sep 15, 2010

I am querying a single string column in a table. The string values have spaces in them. I want to loop over each value in bash. I set IFS to split lists on newlines instead of spaces. When I try this, it is splitting the list of results on the actual character 'n', not the newline ''.

DATA=`mysql -u root -ppassword --silent 'SELECT name FROM table_a;'`
IFS=$'
'
for i in $DATA; do
echo "item = $i"

[Code]....

View 5 Replies View Related

Programming :: Split Mysql Date Query Or Hide Some Output?

Feb 22, 2011

So I've got a rather vast database, one of the columns is date in the following format: DD/MM/YY HH:MM:SS. This is starting to cause problems with a php page I'm writing which asks the user for a 'start date'. Would it be better for me to split the date column into date and say time? Or is there a way of using distinct and masking the times.

View 10 Replies View Related

General :: Assigning Query Result Into A Variable/file?

May 25, 2011

I am connecting to MySQL DataBase using shellscript and writing a select statement like select attachmentid from attachments where pageid=10175 I want to store the output of the select statement into a shellvariable or a file. How can i do it using shellscript.

View 4 Replies View Related

OpenSUSE :: MySQL Query Browser For 11.4?

Apr 14, 2011

Can query browser be installed in 11.4??

I've tried to use workbench but it's such a big step backwards in that you can't easily edit the output from a "select x,y,z from table" query. I'd have thought that was a pretty basic requirement...

View 5 Replies View Related

General :: Adding DATE_SUB To A Mysql Query?

Sep 21, 2010

I have the following mysql query which works great.


Code:
SELECT msg FROM `logs` WHERE ((`host` = 'aaa.bbb.ccc.ddd') OR (`host` = 'aaa.bbb.ccc.ddd')) AND `msg` REGEXP CONVERT( _utf8 'physical addresses' USING latin1 ) COLLATE latin1_swedish_ci
I need to refine this query so that I can query the last # hours using the `datetime` field in the database. I have researched the DATE_SUB function and can query for example the last 1 hour like this:

[Code]....

View 10 Replies View Related

General :: MySQL Slow Query Log Rotate ?

Jan 17, 2011

I am on a CentOS 64 bit and used webmin to rotate MySQL slow query log. Now the thing is although logs are being rotated daily but the new log files being created are empty which means MySQL is unable to write them due to some reason. I have checked using "ls -l" that both permission and owner of files is same but still MySQL is not writing logs. What could be the reason?

View 10 Replies View Related

Server :: MySQL Query Browser Connection Help

Jan 28, 2010

i have MySQL on my CentOS server and have installed it and got it up and running through the command line.

I have changed root's username and password so there is no user called 'root' anymore. I also created a database called pancakes.Now when i try to log in using Query Browser, i put the server's IP in 'hostname', my new roots username and password in 'username' and 'password'.When i try to log in it gives me error 1130 and says connection from myhostname not allowed.

View 6 Replies View Related

General :: Install Mysql Query Browser In Debian?

Mar 17, 2011

I want to install mysql query browser in debian

View 1 Replies View Related

CentOS 5 :: MySQL Subsecond Slow Query Log Patch Installation?

Aug 31, 2010

I am using MySQL 5.0.77 Version rpm on CentOS 5 Red Hat Linux. I want to install micro second slow query log patch on this MySQL S/W version.As I found the slow query micro second patch on percona site i.e. [URL]step by step to install above mentioned patch with rpm based MySQL installation? Do we need MySQL source files to apply patch ?

View 13 Replies View Related

Programming :: Insert Line Of Text Prior To Pattern Only Once?

Jun 29, 2010

I have a file like so:

Code:

one
two
three
four

I would like to insert prior to the word "three" all items from this second file with the following contents:

Code:

four
three
two
one

Now my issue is, and I have been using both sed and awk currently, that after the second line of the new file is read there will of course now be 2 copies of the word "three" but I would like to only insert the final 2 words, ie "two" and "one" prior to only the first occurrence of the word "three" so final file will look like:

Code:

one
two
four

[code]....

So here there is now only one of each word from the second file joined to make the new file. For simple code I have tried something like the following:

Code:

while read line
do
awk -v n=$line '!f && /three/{print n;f++}1' file1 > tmp_file
mv tmp_file file1
done < file2

Now this works but seems very clumsy to me. There is obviously a better sed and / or awk out there.

View 5 Replies View Related

Fedora :: Get A Link To Download MySql Query Browser(windows Version)?

Jan 16, 2011

Does anyone know where I can get a link to download MySql query browser(windows version)?

I want to query my database on my fedora box in windows to make life easier... I can not seem to find a link to download the query browser though

View 2 Replies View Related

General :: Run A Query Browser For Mysql - X11 Connection Rejected Because Of Wrong Authentication

Nov 17, 2010

I am running Ubuntu 10.04 LTS. I am trying to run a query browser for mysql but keep receiving the following error:

X11 connection rejected because of wrong authentication.

The application 'mysql-query-browser-bin' lost its connection to the display localhost:10.0; most likely the X server was shut down or you killed/destroyed the application.

In ssh_config, I do have ForwardX11 set to yes.

View 4 Replies View Related

Server :: MySQL Error 134 From Storage Engine Query: Select Data, Created, Headers?

Mar 1, 2011

I need help about the error in my website. I have the following error....

Code:
user warning: Got error 134 from storage engine query: SELECT data, created, headers, expire, serialized FROM cache WHERE cid = 'theme_registry:database1' in /var/www/html/web/includes/cache.inc on line 26.

View 2 Replies View Related

Programming :: Change Complex Number Display Mode (like -123.45e67 In To Real)?

May 9, 2011

How to change the complex number like -123.45e67 in to real number.
with command of awk print

View 1 Replies View Related

General :: Mysql Query With Unix Timestamp Error "check The Syntax Near The Between"

Jun 28, 2010

Quote: select * from s_transaction Where between UNIX_TIMESTAMP('2010-06-28 15:40:00') and UNIX_TIMESTAMP('2010-06-28 16:00:00') and user_id = '15545941';

Is this the syntax correct to retrieve a particular user transaction between given time period? because "its return error check the syntax near the between"

View 3 Replies View Related

Debian Programming :: Generate SQL Result Into XML

Dec 2, 2014

How do I generate sql result into xml ? Tried this way (shown below), but it generates all data into single column.

Code: Select allgenerate_xml()
{
        f1=_tmp1
        f2=_tmp2
        cat $SQL_QUERY_OUT |sed -e 's/^"//g;s/"$//g;s/","/|/g'|tr '|' ' ' > $f1
        [ -e $SQL_QUERY_OUT ] && rm $SQL_QUERY_OUT

[code]....

View 2 Replies View Related

Programming :: Get Different Result Of Matrix Op On Hw Rtw Book?

Jul 31, 2011

Dear Linux/c++/g++ programmers: the run result on my system, ubuntuLinux10.04(kernel2.6.35-25), gcc4.5.2 is not what book predict

source code
http://examples.oreilly.com/9780596007614/
11-28
11-29
11-24
#include "matrix.hpp"

[Code]...

View 13 Replies View Related

Programming :: Cut The String In The Result Generated By AWK?

Aug 5, 2010

I wanted to get the ORACLE_HOME of the listener's running on the server.I have been using the following to get the reult. /opt/oracle/admin/PHYPE/bdump> ps -ef|grep /bin/tnslsnr|grep -v grep|awk '{print $9}'

Result is as follows

/opt/oracle/product/10.2/bin/tnslsnr
/opt/oracle/product/9.2.0/bin/tnslsnr
/opt/oracle/product/10.2/bin/tnslsnr
/opt/oracle/product/10.2/bin/tnslsnr
/opt/oracle/product/9.2.0/bin/tnslsnr
/opt/oracle/product/10.2/bin/tnslsnr

Now i wanted to cut the /bin/tnslsnr part and the remaining should write to the file.

View 4 Replies View Related

Programming :: Setting The Final $result

May 18, 2010

I have a variable (call it $valAS) that gets calculated . Also, i have a files Bassu3. if $valAS= 45368 (2nd part of 2nd line in Bassu3) after calculation, then $result=45368, but if $valAS != 45368 then $result= $valAS

Bassu3:

Quote:

name.srv
name 45368 (value always changing)
name 99999
name 88888

how can i do this in Bash?

View 14 Replies View Related

Programming :: Specific Result Of Awk Script

Jan 24, 2010

I'm using the following awk command to find out the users home directory from /etc/passwd file.#grep jeesun /etc/passwd |awk 'BEGIN {FS=":"};{print $6}'But problem is when there are two name like "jeesun" and "jeesunadm" exist the script shows both result not specific one.

View 3 Replies View Related

Programming :: Show Images From A Database Result?

Jun 17, 2010

I was wondering if I can show an image on our php site if we store the path to it. For example if we get the result form my sql as:

images/example1.png and the handle the result as common html.

< img src="databaseresult" width="173" height="188" border="1" / >

is this possible? do you think theres a better way to do it?

we need to store the images locally we cant use a blob space on the table.

View 2 Replies View Related

Programming :: Regarding Query Protocol On Internet?

Jul 17, 2011

There is a protocol in use - for example when I use Firefox to do a query through Google - as I type into the search field the browser sends my characters - one at a time - to the server. As I recall, at one time I found the specification but I'm pulling a blank. As I recall it does a POST of each character as I enter it, and the server responds before I have entered a <CR>. I want to write a client side program that uses that protocol and need to see the spec.

View 2 Replies View Related

Programming :: Quick Query To Web Developers?

Mar 31, 2010

What is the code snippet required to get an image to repeat vertically up a page? I can only find info relating to repeating *background* images in my search attempts, and this is just a regular image file which I want to repeat over the pre-existing page background. I'd like it to repeat all the way up the extreme left hand edge of the page. Say the image is called abd.jpg and is in the same folder as the index.html.

View 14 Replies View Related

Programming :: Pass An Expect Command Result Into A Variable And Then Use It Again?

May 4, 2010

I'm trying to create a program that would locate the oldest file of a certain type on a server. Here's the commands:

OLDEST_PATH=`find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1`
OLDEST_FILE=`find -L $OLDEST_PATH | grep .mp3 | sort -f | head -1`
ls -al $OLDEST_FILE

I'm writing this all in expect but I'm having problems. The main problem I have is whenever I try to run the first command, I can't seem to isolate the result of the OLDEST_PATH so that the 2nd command will work. There always seems to be a newline in the variable and the result is only "find -L" command running and it bypasses the variable. If I can just figure out how to get the 1st and 2nd command to work, then I can figure out the 3rd. Here's some code:

Code:
send "find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1
"
sleep 20
expect -re "(.*)

[Code]....

I know there is a better way to write this. I've tried multiple ways and this just happens to be the last way I've tried it. If you try running this, you'll notice that there is still carriage returns after the result of OLDEST_PATH and it prevents the 2nd "find" command from working properly.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved