Programming :: Insert Query In Mysql ?

Jul 12, 2011

When i enter this query to mysql:


return this error:


when i delete the insert part :


query is ok:


1 row in set (0.00 sec)

View 2 Replies


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

<body bgcolor="#6881bb">


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 :: 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


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:


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 :: 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 :: 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:

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 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;'`
for i in $DATA; do
echo "item = $i"


View 5 Replies View Related

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).

<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 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

Programming :: Insert Values Into A MySql Database?

Feb 9, 2010

I want to insert values into a MySql database. The following line works fine:1

mysql_query(connection, "INSERT INTO main (NumofShows , Title) VALUES('12', 'Home')");
but if the data to be inserted is from a string... like....
string NewTitle = "Monaco";
string NumofShows = "2";

How do i edit my sql statements so variables can be inserted into the Values ( ) , and it will be able to read the variables and then store it into the database.

View 4 Replies View Related

Debian Programming :: MySQL PHP Insert / Update Fail - Select Succeeds

Nov 6, 2013

I have mysql installed successfully. I can insert rows into my table using phpMyAdmin. I can successful retrieve those rows in PHP with a select statement. However, I cannot insert or update rows from PHP. I get no error messages and everything appears to be working okay, just no results in mysql table.

View 0 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.

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:


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

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

Ubuntu Servers :: Trying To Insert JPG File Into MySQL Table

Mar 12, 2011

I would like to store JPG files in a mysql database table. I figured that using BLOB fields on the one hand and the 'load_file' command on the other would do the trick. Here is how I set up the table:

mysql> create table blobtable (id int(10) not null auto_increment,
fileName varchar(15) not null,
file longblob not null, primary key(id) );
Query OK, 0 rows affected (0.51 sec)

Then I tried to enter the data:
mysql> insert into blobtable(filename,file)values('pic',load_file('/var/www/temp/IMGP4764.JPG'));

Which got me the following error signal:
ERROR 1048 (23000): Column 'file' cannot be null

It seems to me that the file path to the JPG file (although correct) is the source of the problem, and is causing the load_file command not to work. My first attempt was with the JPG file in my PC's home directory. When that returned the same error message, I figured that maybe the file had to be in the PC's (server's) web area so I put it under the 'www' directory.

View 7 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....

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/ on line 26.

View 2 Replies View Related

Fedora :: Inserting To Escape Single Quote For Mysql Insert?

Oct 2, 2010

the project I'm working on requires parsing a text file with fields separated by the | char and using perl to insert/update a mysql database. Some of the fields are simple numeric and others are text fields. In some of the text fields I run into a problem creating a proper insert statement for the perl api to mysql if I don't escape the single quote (') char with a backslash (). I can take each text file and do a manual subsitutiton, but I would prefer to use the script that prepares the text file to do it for me. I've tried sed (ex: sed s/'/\'/g ) and it runs cleanly, but does nothing to accomplish my goal. I suppose I could write a function to read the file character by character and write it out that way, but it seems a waste.

View 2 Replies View Related

Ubuntu Servers :: LAMP - Insert UK Formatted Date Into MySQL

Sep 5, 2010

Trying to take a UK formatted date (30/12/2010) and insert it into Mysql (2010-12-30) is just not going to plan. I have a feeling I'm getting close, however it's just not working out.

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$unformatted_date = $_POST['date'];
$formatted_date = substr($unformatted_date,6,4) . "-" . substr($unformatted_date,3,2) . "-" . substr($unformatted_date,0,2);


View 3 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

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 :: Handle Query Strings Using Socket?

Dec 7, 2009

I need to make a daemon which listens to port 81 for messages like [URL] So far I made a daemon which serves as a simple stream server: I set up a socket to listen to a non-reserved port (like 9999), but I don't know how to read the query strings.

Linux distro: Kubuntu 9.04
Language: C

View 5 Replies View Related

Programming :: Passing Variable To Oracle Query With PHP

Jul 11, 2011

I'm having some trouble this morning to send a SQL query to our Oracle DB server in PHP. When I try to pass my value "OF/110246801A01" as variable it tell's me "Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number"

PHP Code:
$ociO ='OF/110246801A01';
$selectAllFieldsFromOf=oci_parse($conn,"SELECT*FROMMFGOPEWHEREMFGNUM_0LIKE':ociOf' ");
$resultQuery =oci_execute($selectAllFieldsFromOf);
$e = oci_error($selectAllFieldsFromOf);
return trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);

View 1 Replies View Related

Programming :: Query To Compare Records Of Two Different Tables?

Dec 31, 2010

i am trying this query to compare records of two different tables...i m geting this message!! no required out putvalues for these ($jobTitle $industry $stationBase $gender $maritalStatus)are coming from textboxes!here is the code...

PHP Code:
$query = "(SELECT *,
MATCH(industry, gender, maritalStatus , typeofWorkPosition , preferCity) AGAINST ('$


View 4 Replies View Related

Programming :: Query Of Commands That Made Executable With Chmod +x?

Aug 24, 2010

I have written a query of commands that I made executable with chmod +x, but this is an old version of what I'm writing. I'm in need of a way to determine the Operating System the user is using so that the script will run yum or apt-get on the right OS's.

View 11 Replies View Related

Programming :: Shell Script Query - How To Achieve The Results

Feb 7, 2010

how do I achieve the result but here is the story. I have a script which prompts for the IP Address and read that value and validate if reachable. If not then it should keep on prompting until the IP is reachable. I tried using until loop as well as while loop but dang..Here are the codes

IP_Feed () {
echo -n "Give me IP : "


View 4 Replies View Related

Copyrights 2005-15, All rights reserved