#include #include #include #include "globals.h" #include "functions.h" int db_open_mysql(char *newtoken,char *variable) { int tokentype; char token[TOKENSIZE]; int paren=0; char UID[TOKENSIZE]; char passwd[TOKENSIZE]; char database[TOKENSIZE]; char address[TOKENSIZE]; char dsn[TOKENSIZE]; char temp[LINELENGTH]; tokentype=gettoken(token); if (strcmp(token,"(")==0) { paren=1; tokentype=gettoken(token); } if (global_uid[0]==0) { getvar(UID,token,"uid"); } else { strcpy(UID,global_uid); } if (global_passwd[0]==0) { getvar(passwd,token,"pwd"); } else { strcpy(passwd,global_passwd); } if (global_dsn[0]==0) { getvar(dsn,token,"dsn"); } else { strcpy(dsn,global_dsn); } if (global_database[0]==0) { getvar(database,token,"database"); } else { strcpy(database,global_database); } if (global_address[0]==0) { strcpy(address,"localhost"); } else { strcpy(address,global_address); } if (tokentype==10 || tokentype==11) { sprintf(newtoken,"$%s=mysql_connect(\"%s\",\"%s\",\"%s\");\n", variable,address,UID,passwd); /* for (r=0; r