I'm not getting any errors at all and the program runs just fine, except
that it's not inserting! :) selects work and everything else. Am I
missing a function or structure? Thanks...

James Gosnell
[EMAIL PROTECTED]
#include <stdio.h>
#include <mysql/mysql.h>
#include <sys/time.h>




int main (void) {

MYSQL *connection, mysql;


    if (!mysql_init(&mysql)) {

        printf("Error initializing MySQL client\n");
        exit(1);
    }

    if (!(connection = mysql_real_connect(&mysql, "localhost", "root", "fender", "", 
0, "/tmp/mysql.sock", 0)))
        printf(mysql_error(&mysql));

    if (mysql_stat(connection)) printf("%s\n", mysql_stat(&mysql));

    if ((mysql_query(connection, "insert into customer
(last_name,first_name,middle_name,address,city,state,zip,home_phone) VALUES
('Gosnell','James','Matthew','1008 Rhoads Hall','Terre
Haute','IN','47809','812-237-7094')")))
   mysql_error(connection);


mysql_close(connection);

exit(1);

}

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to