Tuesday, March 18 2003 @ 10:36 AM EST
Contributed by: WAW401
Views: 4,550
I wrote the following php script to download the selected contact with the main company info in vCard format (tailored for Mac OS X Addressbook). This was my first php ever, copy and pasted together to get it to work, so please don't judge too harshly :-)
I have an icon in the viewp.php screen which is linked to http://mydomain.com/contact/vcard.php?c_id=240&c_type=1. Now that I think about it, I can't remember if c_type is even used since this only shows in viewp.php.
// open connection to database $connection = mysql_connect("localhost", , ) or die ("Unable to connect!");
mysql_select_db("geeklog") or die ("Unable to select database!");
$query_p = "SELECT * FROM ct_person where (c_id = '$c_id')"; $result_p = mysql_query($query_p) or die ("Error in person query: $query_p. " . mysql_error());
if ($row = mysql_fetch_assoc($result_p)) { $query_c = "SELECT * FROM ct_company where (c_id = '$row[co_id]')"; $result_c = mysql_query($query_c) or die ("Error in company query: $query_c. " . mysql_error());
The following comments are owned by whomever posted them. This site is not responsible for what they say.
vCard export from contacts
Authored by: tomw on
Tuesday, March 18 2003 @ 10:55 AM EST
No criticism from me. I always appreciate people who take something and make it do what they want. I learned to program by hacking cpm (predecessor of msdos) and making it do what it was not intended to do.
One little problem area that you might have is the direct connection to the mysql database instead of using geeklogs methods. This could cause some conflicts and possible corruption.
Authored by: anonymous on
Wednesday, March 19 2003 @ 02:11 PM EST
I think this is a great idea. What the Contacts Plugin really needs is a way to import from a csv file. This would let people export from Outlook and then import into the Contacts Plugin.
Authored by: anonymous on
Monday, March 24 2003 @ 02:43 PM EST
I found a script that will do CSV importing into MySQL via a graphical interface. All you do is upload and run. Nothing to setup. Very cool. http://www.hotscripts.com/Detailed/18098.html
No criticism from me. I always appreciate people who take something and make it do what they want. I learned to program by hacking cpm (predecessor of msdos) and making it do what it was not intended to do.
One little problem area that you might have is the direct connection to the mysql database instead of using geeklogs methods. This could cause some conflicts and possible corruption.
TomW