Q:

Changing URL via SQL

With only a basic understanding of SQL and PHP, I've been trying to migrate a Wordpress layout built on a local server:
http://131...

to 
ceje.webhost.uic.edu

Once I changed the 'siteurl' and 'home' in phpmyadmin, the styling and pictures failed to load. It seemed that before the change, it was still pulling the pictures from the locally hosted website. 
Please correct me if I'm wrong, but a URL change should fix this? All of the files have been uploaded to the new hosting server space, so therefore should be accessed by "ceje.webhost.uic.edu/..."?
I tried in sql query on phpmyadmin:
USE **databasename**;

UPDATE wp_options SET option_value = replace(option_value, 'http://131....',       
'http://ceje.webhost.uic.edu/') WHERE option_name = 'home' OR option_name = 'siteurl';

but returns error 1064
MySQL said: Documentation

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

edit: fixed a syntax error in the sql query, now getting back no rows return.
# MySQL returned an empty result set (i.e. zero rows).

EDIT: Solved by simply applying the following code to functions.php file.
update_option('siteurl','...');     
update_option('home','...');

A:

When migrating the site the image urls are not changed. Granted you need to change both the site/home url for the website to even show.
When migrating a site the best thing to do is to install the following plugin. 
http://wordpress.org/plugins/search-and-replace/
This will allow you to search and replace in the database as image links will be found in many of your tables ie wp_posts where all your post data is held will have image urls in the post content for example. This plugin will search all tables for the old url and replace it with the new url you give it.
If you have hard coded any images in the files with absolute urls, then you will have to change this manually.
I have used the plugin many times successfully, but I still back up the database every time just in case and I would advise you do the same.

