Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Insert 'http://' Where Row Starts With Www.


I need to insert "[url]http://"[/url]; to the beginning of each row where a URL has been entered as www.anything.com (for example) to the row becomes (http://www.anything.com)

I don't know how I can do this without over writting all the current URL's with out the prefix "[url]http://"[/url]; in a URL and whether it can be done.




View Complete Forum Thread with Replies

Related Forum Messages:
HTTP Connection
Can anyone give me some brief description on how to establish HTTP connection from MySQL as we use UTL_TCP.CONNECTION in Oracle.

View Replies !
PhpMyAdmin :: Http Authentication
How do you get http' authentication to work with phpMyAdmin?? Every time I tried using that i can't login.

using
WIN XP PRO
Apache 2,
phpMyAdmin2.6.0-pl3,
php 4.3.10
mysql 4.1

View Replies !
Starts And Ends
--Apple-Mail-2-720579055
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed

when I enter:
cd /usr/local/mysql
sudo chown -R mysql data/
sudo echo
sudo ./bin/mysqld_safe &

mysqld starts and ends. I am using a Mac with OSX 10.2.4 and have
installed 4.0.4

Any assistance would be greatly appreciated!

Helen
--Apple-Mail-2-720579055--

View Replies !
Field Starts
How do you do a search for checking if the field starts with a certain value. What I am trying to do is search article titles for titles that start with "a" or "b" or "c" etc. Basically like on websites where you can find products by clicking on a list of letters. Do I need to grab all the articles and manually check this or can I do this in MySQL?

View Replies !
Id Starts From 1 After TRUNCATE
is it possible to let the id of a table to count from 1 afted it's been truncated?

View Replies !
Starts With A Number
Is it possible in a query to select all the records that have a number (as opposed to a letter) as the first character in a particular field? If so, how would you word the query

View Replies !
MySQL Execute An HTTP Request
Can the MySQL engine execute an HTTP request?

Here is he scenario. I have a table that rarely changes but when it does I need to notify a web service. Is it possible to create a trigger that will make an HTTP call when fired and pass a couple of the field values as URL parameters.

View Replies !
Receiving Sms Messages By HTTP Push
I need to receive sms messages from my isp into a php database & am a real php newby, so apologies in advance if this has been covered. I did look through the forum!

According to the docs, "The HTTP push API allows incoming SMSs, including replies to outgoing SMSs, to be routed back to you via HTTP. HTTP GET is used, and all data are sent as simple query parameters."

Is it as simple as writing a get statement, in say, "http://www.mydomain.dom/incoming/deliver.php?pass=blahblah" and having that insert the parameters sent into the database? Then upload the deliver.php file to my server and leave that to be called by the isp when sms messages arrive?

View Replies !
Http Error Code 403 Forbidden
I am using a mac and dreamweaver. I bought a book on how to use php and sql with dreamweaver. the example in the book allowed me to access a database and it worked very well. when I went to use this in real life and create my own database I get the 403 error.

Here is the fun part. I created a database on my server and I can't access it from the site I created it for, but I can access that database from the site created by the book that the example came in.

bottom line

Sample site created from text book can access all the databases I create

Site that I created can not access any databases.

anyone have any suggestions?

yes I added a index.html file to my root directory.

I am hoping it is as simple as I missed a radio button somewhere to turn someone on in my site.

View Replies !
Cannot Connect To MySQL Server On Http:8500
I'm trying to get a local ColdFusion development environment set up in order to develop an e-commerce site. I want to use MySQL as my driver, which is installed and running (ColdFusion MX also installed and working). I'm in the ColdFusion administrator and am trying to submit my DSN, however it comes back with the error message:
'Cannot connect to MySQL server on http:8500. Is there a MySQL server running on the machine/port you are trying to connect to?'

I put in http://localhost:127.0.0.1 (local) as my server and 8500 as my port. Is this correct?

View Replies !
Connect To Remote Server Through Http Proxy
My work recently installed an http proxy and now I can now longer connect to remote servers using the mysql client on rhel 5 (both are human genome databases).

mysql -h genome-mysql.cse.ucsc.edu -u genome
mysql -h ensembldb.ensembl.org -u anonymous

I never had problems connecting to these sites before the http proxy was installed 1 month ago. Both statements above return the same error, so I doubt both are down at the same time, but I don't know.

ERROR 2003 (HY000): Can't connect to MySQL server on 'genome-mysql.cse.ucsc.edu' (113)
ERROR 2003 (HY000): Can't connect to MySQL server on 'ensembldb.ensembl.org' (113)

View Replies !
Auto-increment Starts On Highest Value
When this has been created, the ID has been generated to 2147483647 and when I try and create another record it fails because nothing can go higher than 2147483647 (I think)

The auto-increment has been started at 2147483647 no idea why, and from there when I atmysqlt to create another record it will fail because it ascends from that value.

View Replies !
Mysql Starts Multiple Php-instances
i have a little problem with a server, running mysql and php. I don't know which php-version i am working with, but the following is the answer for 'mysql --version'

mysql Ver 11.18 Distrib 3.23.52, for suse-linux (i686)

I know, that this version is not the newest one, but thats not my business.

My problem is that i need to execute a script, which starts mysql with this command:

mysql -hlocalhost -uuser -ppass db < $update > $update_log

whenever this command is running and the 800k $update file is working on the db (a lot of delete and insert statements) there are several php-instances created.

So many that they are slowing-down the server, that he is unusable.

View Replies !
Ereg String Starts With Number
Does anyone know the ereg syntax for MySQL to return results that start with a number?

E.g.

ereg('[0-9']*, $string);

but for an SQL statement.

View Replies !
Mysqld_multi Don't Starts Groups On Linux RedHat 9
mysqld_multi doesn't start the two groups if I gave this command imediately after stopping them.

View Replies !
How Do I Preserve The Leading Zeros That I Insert Into A Table As Part Of My Insert
how do i preserve the leading zeros that i insert into a table as part of my insert query?


View Replies !
Insert Multiple Rows With One Insert Stmt And Nested Select
I'm trying to insert several rows into a table using only one insert statement:

insert into component_feature values (select 3,1,sf.software_feature_id,1 from software_feature sf where sf.software_id = 1)

When I run the select statement alone, I get the result I want:

+---+---+---------------------+---+
| 3 | 1 | software_feature_id | 1 |
+---+---+---------------------+---+
| 3 | 1 | 0 | 1 |
| 3 | 1 | 1 | 1 |
| 3 | 1 | 2 | 1 |
+---+---+---------------------+---+

But when I run the complete statement I get:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'select 3,1,sf.software_feature_id,1 from software_feature sf where sf.software_i' at line 1

This query is part of a PHP application I'm building. I'd rather not have to write a PHP loop to do multiple inserts.

View Replies !
Mysqldump Options :: --extended-insert --complete-insert
Adding options like extended inserts or complete inserts (or both) make no difference to the output file. Why?

mysqldump -uroot -pmypass! --databases test --tables proxy_view > mytest.txt

mysqldump -uroot -pmypass! --extended-insert --complete-insert --databases test --tables proxy_view > mytest.txt

Both the commands mentioned above saves a same set of commands.

insert into tablename (column names) values (set of values), (another set of values), (one more set) Whereas I want

insert into tablename (column names) values (first set);
insert into tablename (column names) values (second set);

Ok. --skip-extended-insert is what I was looking for

View Replies !
How To Insert Multiple Rows With 1 Insert Query
I am having a form on the front end which has for example 3 rows each with 3 columns. The user enters data in all the 3 rows. When he hits the add button these should get in the database. What insert query would I write to add all of them together to the database? Do I need to use some procedure?

View Replies !
Can't Insert Image And Zip File But Can Insert Txt ,doc And Classes File
Mysql version is 5.1.
java program language

I put some data into the database .

following is table which I want to put datas.

+----------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| filedata | mediumblob | NO | | NULL | |
| filesize | int(11) | NO | | NULL | |
+----------+------------+------+-----+---------+----------------+

but ,when I insert image(jpg,gif ,etc) ,zip and rar file .The control show following message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cl|??u×??"a?!???>?TH°>?V?ìF^é?? ??? $?c^fSí k??é?t'”??5 <4?9B?ü?E6?—W?' at line 1 .

notice : I come from China ,so I set encoding is gbk .but I think this has nothing to do whith the error.

View Replies !
Not Getting Last Insert Id
I am using a custom php class where i have wrapped all the mysql
connection settings and query functions. Instead of calling direct
mysql functions i creat an instance of this class and than use the
custon functions for query, connection etc. At some places i also use
direct php mysql functions to connect and query.

My problem is that on my web site sometime i dont get last insert id of
an insert query. Is it because connections are shared or is there some
other problem. If i force mysql to always open a new connection for
query will it overload my server.

View Replies !
Get The ID During INSERT
Is it possible to get the ID (autonumber) of the current row I'm inserting.

I know you can use LAST_INSERT_ID() method but it only works if I do this after the INSERT. What I'd like to achieve is something like this .....

View Replies !
Cant Insert Value
i have a database that i downloaded and tried to insert some fields on it using phpmyadmin..when i do that, it would create an error and tells me that the table is read only..how can i insert the values i wnt to the table

View Replies !
INSERT With WHERE
I have an existing table that has already a few fields that are filled with data. This table contains also a few empty fields. I want these empty fields to be filled with data while specifying the row where this data has to be putted.

Appearently INSERT and WHERE can't be a combination.

View Replies !
How To SQL Insert
I'm stuck about inserting certain data into a database using SQL and PHP, is it possible if anyone knows any SQL to post it?

View Replies !
An Insert
Is it possible to make and insert in a table only if the record does not exists in the table

View Replies !
Help On Insert
i m trying to insert a new records into a table,
my query is

INSERT INTO test
SET rank = ( SELECT max( rank ) + 1
FROM test )

i have a error returned (#1064)

may someone help me to find the correct syntax?

View Replies !
INSERT [INTO]
i'm curious about the meaning of 'INTO'. in the mysql-docu, it is declared as an optional keyword

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name [(col_name,...)]
VALUES ({expr | DEFAULT},...),(...),...
[ ON DUPLICATE KEY UPDATE col_name=expr, ... ]

but each of the following examples is 'INSERT INTO', there ist no 'INSERT' without 'INTO'.

So what is the a difference between 'INSERT' and 'INSERT INTO',

View Replies !
INSERT INTO DB
I'm just trying to do the following very simple INSERT:

INSERT INTO TABLENAME(ID, DESCRIPTION, CATEGORY)
VALUES(null,'This is the description (£)',2);

I receive a Data too long... for column error, the problem is with the £ sign, can anyone tell me how to insert a £ sign as part of a VARCHAR2 insert. The current db character set is UTF8.

View Replies !
Insert One Value After Another Value
give me the syntax to insert a new row of data in a particular place in a table? I think it is something close to:
INSERT INTO Table VALUES ("X") AFTER ?

I am trying to add a record to an alphabetized list. I don't want to query the list to alphabetize it, but actually have the data alphabetized.

View Replies !
Insert CSV
I am trying to upload a CSV file from Excel to my database through phpMyAdmin. I used the "Insert Data From A Test File" option at the bottom of the table structure page. It works fairly successfully, but it only inserts the first row of data from my CSV file. What am I doing wrong?

View Replies !
How To Always Insert In To Last Row
I am making my first PHP/mysql script and I have run in to a problem. Say I have a table with a unique ID that auto increments:

ID ,NAME, DATE
1 , EXAMPLE1, DATE1
2 ,EXAMPLE2, DATE2
3 ,EXAMPLE3, DATE3

So every time I add a new record, its inserted and the ID autoincremented. That part is working fine.

The problem I´ve run in to is when I tried to delete a record, say record ID #2,
it´s deleted. But when I try to insert a new record, it´s inserted where the deleted ID used to be.

So in my example,after I delete record #2 and I want to insert new record #4 this is what I get:

ID ,NAME, DATE
1 ,EXAMPLE1, DATE1
4 ,EXAMPLE4, DATE4
3 ,EXAMPLE3, DATE3

Notice that it gets the ID# correct, but I actually want it to go after ID#3,like so:

ID ,NAME, DATE
1 ,EXAMPLE1, DATE1
3 ,EXAMPLE3, DATE3
4 ,EXAMPLE4, DATE4

Since I am a MySQL newbie I´m pretty sure there must be some sort of setting when I create the table that will make this work the way I want it to, but after lots of reading and searching I havent been able to find it.

View Replies !
Insert New Row Only If There Is No Such Row...
e.g. I have table t (c, a, b);

I want to insert information in the table only if a and b are not present.

I used to write :
if not exists (select c from t where a="from" and b="from")
insert into t(a,b) values("from", "from");

as I always get an error, I read that there is 'not exists', and 'if' functions, but...

how can I rewrite this query into a good query( I must use joins and etc.? :( )?

or should I make unique composite index on a,b columns? :) and ignore errors when inserting?

View Replies !
Using USE &amp; INSERT
I am trying to help someone install an addon to an existing script. The addon uses one database and the existing script uses another. The purpose of the addon is to allow the 2 databases to share login information so new users don't need to login separately.

Anyhow I have installed this successfully on my site and another site. This person I am helping has a database name that I believe is causing the issue and I am not sure how to help this person work around this, as it appears their host/server is creating the part of the database name causing the trouble.

So I need to know how to instruct them to run the "sql" query successfully.

The code is shown below, the issue appears to be with the use of the "-" character in the databae name. I tried to create this "-" in the database name on my test site and the server eliminates the "-" and created the database without it, so I couldn't test it.

Code:

View Replies !
Insert A Value
how to write my sql so I can insert a value that is in the $GLOBALS array.
Here is my code which does not have syntax errorss (when I don't refer to $GLOBALS but I also don't get the value !!!)
$query = "INSERT INTO `T_Car` (`T_Car_NewPrice`) VALUES ('$Db_Car_NewPrice')";

here is the code which I would like to have (since the variable value is in $GLOBALS)

$query = "INSERT INTO `T_Car` (`T_Car_NewPrice`)
VALUES ('$GLOBALS['Db_Car_NewPrice']')";

I tried different alternatives of this previous syntax (ie surrounded by {} or ' ' but without success.

View Replies !
Insert Value.
i have table field which type is LONGTEXT. i cant insert any type of text except text with '. example: i've done it.
when i submit my form everything is ok but data is not inserted in my table.

View Replies !
Last Insert ID
Scene
ID: Long, auto incremental, index
Content: VarChar(1000)
CreateOn: Date
TestID: VarChar(12)

TestID is of the format "T-YYYY-ID", ie: T-2008-00001, where 00001 corresponds to the ID which I have just inserted.
Any idea how to do it?
Ideally, in ASP.NET, the command would be
insert into Scene (Content, CreateOn, TestID) Values
("testContent", DateTime.Now, "T-"+DateTime.Now.Year.ToString()+"-"+Mysql_last_ID()); ??? or
insert into Scene (Content, CreateOn, TestID) Values
("testContent", DateTime.Now, "T-"+DateTime.Now.Year.ToString()+"-"+Max_ID+1);

I have managed to do it, but was wondering if I can improve it by using a subselect? Currently using ASP.NET with MySql.Data.MySqlClient

MySqlConnection conn = new MySqlConnection(connectionString);
MySqlCommand command = new MySqlCommand("Insert_Scenario", conn);
command.Parameters.Add("?content", MySqlDbType.VarChar, 1000);
command.Parameters.Add("?createOn", MySqlDbType.Date);
command.Parameters.Add("?testID", MySqlDbType.VarChar, 15);
command.Parameters[0] = "testcontent";
command.Parameters[1] = DateTime.Now;
command.Parameters[2] = " "; //insert empty first
command.CommandType = CommandType.StoredProcedure;
command.ExecuteNonQuery();

// Get latest ID
string strSQLSelect = "SELECT @@IDENTITY AS 'LastID'";
MySqlCommand dbcSelect = new MySqlCommand(strSQLSelect, conn);
MySqlDataReader dbrSelect = dbcSelect.ExecuteReader();
dbrSelect.Read();
long intCounter = long.Parse(dbrSelect.GetValue(0).ToString());
dbrSelect.Close();

// Format new command string
string tno = "T-" + DateTime.Now.Year.ToString() + "-" + intCounter.ToString().PadLeft(5, '0');
string sqlCommand = "Update Scene set TestID='" + tno + "' where ID=" + intCounter.ToString() + ";";

// Update the column
MySqlCommand command1 = new MySqlCommand(sqlCommand, conn);

command1.CommandType = CommandType.Text;
command1.ExecuteNonQuery();

conn.Close();

View Replies !
INSERT INTO W/$var
I'm building a script installer that must prepopulate a MySQL table according to vars set in the config file:

// Configure the following variables
$primary_email = "agreements@yoursite.com"; // System email address
$admin_email = "admin@yoursite.com"; // Administrator's email
$extra_email = "additional@anothersite.com"; // Additional email

$db = @mysql_connect("$host", "$dblogin", "$dbpass");

$sql= "INSERT INTO ".$tablepre."admin (id, level, e_robot, e_add1, e_add2, thanks_url)
VALUES (1, 1, ".$primary_email.", ".$admin_email.", ".$extra_email.", 'thanks1.php')";
$result = @mysql_query("$sql",$db);
No parse error but nothing gets inserted. What am I missing here? It works fine without the vars (naturally).

View Replies !
Cannot Insert
i just don't understand why i cannot insert some form data into MySQL INNODB table:

insert statement$q = "INSERT INTO books VALUES ('$title', '$author')";
return mysql_query($q, $this->connection);
first tableCREATE TABLE books (
title varchar(90),
author varchar(90)
) TYPE=INNODB;

no problem at all insert form data into this table, but when i change the table to CREATE TABLE books (
book_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title varchar(90),
author varchar(90)
) TYPE=INNODB;

i cant insert nothing, very strange! there's no foreign key involved, just a single table. what's the problem?

View Replies !
Insert Using MAX()+1
I have a table like this:

id pnt name val
0 1 x 3
1 1 y 5
2 1 z 2
3 2 x 4
4 2 y 3
5 2 z 6
6 3 x 2
7 3 y 2
8 3 z 3

What I want to do is make an insert that looks for the highest value of "pnt" (for this example: 3), adds 1 (now 4) and inserts the next set of X,Y,Z values to that "pnt"...

I tried this:

View Replies !
Insert And Get Row Id
Is there a way to insert in mysql and return a row ID (of insert) automatically?

i'm considering using php's mysql_insert_id() -- however, i'm wondering what effects that might have if multiple access to the same php page warps the insert id?

View Replies !
New Line In Insert Into
I want to insert a carriage return into a text field. I am using insert into
and /n for newline. The MYSQL database is accessed by a MS Access front end
and the text field appears with a small square where the new line should be.
It appears that the /n is interpreted in Access differently.

Is there a way of putting a carriage return into the field so that it is
seen as such by Accesss?

View Replies !
Insert Links Into Rc?
I recently installed SuSE 9.3 on x86, and it seems to contain scripts
"apache2" and "mysql" in the /etc/init.d folder. However, these two (Apache
or MySQL) are not running when I fresh reboot the machine. I am having to
execute a "./apache2 start" and "./mysql start" every time I reboot.

I am a newbie when it comes to unix admin, and I am trying to read up about
the rc scripts and how they link into the scripts under the /etc/init.d
folder. Before I rush and do what appears "natural" to me (create a S?? and
K?? links in the rc?.d), I'd like to find out some basic questions it
raises:

1. Why would the install place the apache2 and mysql scripts under the
/etc/init.d but not have any entries in any of the rc scripts?
2. What do I need to do (anything specific to SuSE) to make the apache and
mysql launch on reboot? Which rcN gets it?

View Replies !
INSERT WHERE NOT EXISTS
I'm trying to insert some data into a table and wish to confirm the insert
is good rather than creating an error. I have tried the following (which
works on Sybase)

INSERT customers
(full_name)
VALUES
(''Big Tech Enterprises')
WHERE NOT EXISTS ( SELECT c.*
FROM customers c
WHERE c.full_name = ''Big Tech
Enterprises')

Can anyone advise the correct syntax for MySQL?

View Replies !
Insert Ignore
Are you allowed to use the following syntax in Mysql 4.0.17-nt :

INSERT DELAYED IGNORE INTO `mytable` ( `ID` , `A` , `B` ) VALUES
("'.session_id().'", "2", ROUND(NOW()/10000) );

I am particularly interested in the delayed ignore. I want to make sure
that no matter what, the instruction is carried out and that, due to
indexes, the data is not allowed to go in, that we do not get an error.

View Replies !
Insert Row Between Old Rows
Insert row beteewn to old rows. I have a database and I need a certain order of the rows, and would like to insert a row between tod old rows. Can that be done?

I use phpmyadmin and i belive i once saw such a feature, but I can't find it now.

View Replies !
Update And/or Insert?
I'm using MySQL with PHP. I want to update a record if it already
exists. If it does not exist, I need to create a new record.

Is this done through a simple SQL command, or do I need to use PHP to
negotiate two separate UPDATE and INSERT statements?

View Replies !
Insert Question
Complete newbie here, so apologies if this is the wrong forum.

I've been asked to use mysql and asp to make a simple bidding system (rather
like a simple ebay), whereby users can use a web browser to view a highest
bid and can make a bid.

My question is; how can I be sure that when a user submits a bid, that
another user isn't also currently submittimg a bid, i.e i can tell user A
that he has the highest bid but then user B who had submitted just before,
but whose insert was still being processed, is actually higher. Is there a
way to make sure all transactions have been completed before the next on is
processed?

View Replies !
Tricky INSERT
I have table A with column id, and table B with columns id and
content.

I am trying to build a query that inserts all ids from table A into
table B, and also sets the "value" field for all these new entries to
a given value.

View Replies !
INSERT SELECT
I need to insert a way that mysql doese'nt complain when i copy some
records that have the same id (or that it just gives it an id according
to the AUTO_INCREMENT)

Thanks again

//Lars Rasmussen

-----Oprindelig meddelelse-----
Fra: Jay Blanchard [mailto:jay.blanchard@niicommunications.com]
Sendt: 13. august 2003 19:59
Til: Lars Rasmussen; mysql@lists.mysql.com
Emne: RE: INSERT .... SELECT


[snip]
I used this command:
INSERT INTO nye_opskrifter SELECT * FROM opskrifter where id
in($numbers)

But now it gives this error:
Column count doesn't match value count at row 1
[/snip]

* does not return a specific number of columns, the work around is to
specify the columns explicitly

INSERT INTO nye_opskrifter SELECT foo, bar FROM opskrifter where id
in($numbers).

View Replies !

Copyright 2005-08 www.BigResource.com, All rights reserved