chrometweaks.org

Free iPage web hosting? Which is best?

Click Here To View All Answers...


Got a question, hope someone can answer... Free iPage web hosting? Which is best? Hoping for any answer or 2. Second question of mine... On my iPage site I have a field called isbn number,.

I have been entering these isbn numbers with spaces.

Thusly.

12 33465 58.

But I need to change them all so that they have no spaces.

123346558.

Is there a query that I can do to change this in sql?..

Comments (28)

I'm stumped. I'm not so sure what is the right answer to your question. I'll do some research and get back to you if I find an decent answer. You should email the people at iPage as they probably know..

Comment #1

I did think of something like that but have no idea how to do it..

Comment #2

This may work - backup db first - and change relevant table(seen twice below to the relevant table where the isbn number is held) - run code below in a php page..

<?php.

$isbn_query = tep_db_query("select replace(isbn,'',' '), products_id from relevant table");.

While ($isbn = tep_db_fetch_array($isbn_query).

{.

Tep_db_query("update relevant table set isbn = $isbn['isbn'] where products_id = '"$isbn['products_id']"'");.

}.

?>.

This post has been edited by.

Yesudo.

: 23 September 2004, 14:28..

Comment #3

Sorry about my absolute biff-ness but how!.

The table that isbn is in is products, the only sql I know is to copy and paste a query into phpmy admin..

Comment #4

Http://www.hostingos...amples/isbn.zip.

Download this file - unzip it - change table name x 2 - then upload it to your store root directory - then use your browser to point to it..

N.B. BACKUP DB FIRST.

This post has been edited by.

Yesudo.

: 23 September 2004, 14:40..

Comment #5

The column is called products_isbn_no so what needs to be changed?..

Comment #6

That has just cleared the isbn from them all..

Comment #7

Tried the new one and it still just wipes the whole thing!..

Comment #8

Final working code:.

<?php.

Include('includes/application_top.php');.

$isbn_query = tep_db_query("select products_isbn_no, products_id from products");.

While ($isbn = tep_db_fetch_array($isbn_query)).

{.

$isbn_no = str_replace(" ", "", $isbn['products_isbn_no']);.

Tep_db_query("update products set products_isbn_no = '"$isbn_no"' where products_id = '"$isbn['products_id']"'");.

}.

?>..

Comment #9

On my iPage site I have a field called isbn number,.

I have been entering these isbn numbers with spaces.

Thusly.

12 33465 58.

But I need to change them all so that they have no spaces.

123346558.

Is there a query that I can do to change this in sql?..

Comment #10

Well, you probably have thought of this, but the first thing that comes to mind is to use concatenate functions with left and right funcitons to get this done. I am sure there is a script out there that does it though..

Http://dev.mysql.com...tion_Index.html..

Comment #11


This question was taken from a support group/message board and re-posted here so others can learn from it.