Rebuilding the iPhoto Library shouldn't result in data loss, however it would be advisable to make a duplicate of the library or back it up with Time Machine before doing so.
You should also, before trying to rebuild the library, create another iPhoto Library and test syncing the pictures. If it doesn't work with a new iPhoto Library, rebuilding will not fix the issue. To create a new iPhoto Library, launch iPhoto holding the option key, and choose the Create New... option. By default it will try to save in ~/Pictures as iPhoto Library_2. Then import some photos, try to sync them to your iPhone. To switch back to the original library at any time, quit iPhoto if it's open, hold option and relaunch then select the original and click Choose.