PDA

View Full Version : How do i copy SomeField of SomeTable data to...


Aou_Student
07-04-2006, 03:11 AM
Hello friends,

Im asking, How can I copy SomeField of SomeTable data to AnotherField of AnotherTable?

Means Im searching for a code that Select data from someField and insert it into AnotherField!

I`ll be grateful if you help me.

Also I need a code that deals with the quotation mark as string (data) not a quotation mark! so It wont break the php code when it`s part of the data to be dealt with.

For Example: When I excute this code "INSERT INTO SomeTable `SomeField` VALUES ('Alen's Site');"

I get this error: 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 's Site');' at line 1.

The quotation mark in (Alen's Site) are dealt with as part of the php code NOT as part of the data to be inserted! I need to fix this some how.

harmor19
07-05-2006, 01:30 PM
What code are you using to insert data into the table?
If you wrote it using vBulletin's functions it should work.

Paul M
07-05-2006, 05:19 PM
You need to escape the single quote in Alen's.

Aou_Student
07-05-2006, 09:23 PM
You need to escape the single quote in Alen's.

I dont want to lose the single quote! how can that be done without losing it?

Paul M
07-05-2006, 10:02 PM
I didn't say lose it, you need to escape it using the escape_string() function. :)

Aou_Student
07-05-2006, 10:16 PM
I didn't say lose it, you need to escape it using the escape_string() function. :)

ok Paut I get what you mean, But I dont know how to use the escape function! I`ll be gratefull if teach me that.