Lines 505-510
Link Here
|
505 |
|
505 |
|
506 |
bool z = FALSE; |
506 |
bool z = FALSE; |
507 |
|
507 |
|
|
|
508 |
char query[1024]; |
509 |
|
508 |
|
510 |
|
509 |
|
511 |
|
510 |
QString sql = QInputDialog::getText(tr("MySQL Navigator"), tr("Please enter database name you will create."), QLineEdit::Normal, QString::null, &z, this ); |
512 |
QString sql = QInputDialog::getText(tr("MySQL Navigator"), tr("Please enter database name you will create."), QLineEdit::Normal, QString::null, &z, this ); |
Lines 515-522
Link Here
|
515 |
|
517 |
|
516 |
{ |
518 |
{ |
517 |
|
519 |
|
|
|
520 |
#if MYSQL_VERSION_ID>=40103 |
521 |
|
522 |
sprintf (query, "CREATE DATABASE %s", sql.latin1()); |
523 |
|
524 |
if (mysql_query(&mysql, query) != 0) |
525 |
#else |
526 |
|
518 |
if((mysql_create_db(&mysql, sql.latin1()))) |
527 |
if((mysql_create_db(&mysql, sql.latin1()))) |
519 |
|
528 |
|
|
|
529 |
#endif |
530 |
|
520 |
{ |
531 |
{ |
521 |
|
532 |
|
522 |
QMessageBox::critical(this, tr("MySQL Navigator"), QString::fromLocal8Bit(mysql_error(&mysql))); |
533 |
QMessageBox::critical(this, tr("MySQL Navigator"), QString::fromLocal8Bit(mysql_error(&mysql))); |
Lines 567-572
Link Here
|
567 |
|
578 |
|
568 |
QString sql = database->text(0); |
579 |
QString sql = database->text(0); |
569 |
|
580 |
|
|
|
581 |
char query[1024]; |
582 |
|
570 |
|
583 |
|
571 |
|
584 |
|
572 |
if(database == NULL) |
585 |
if(database == NULL) |
Lines 605-612
Link Here
|
605 |
|
618 |
|
606 |
|
619 |
|
607 |
|
620 |
|
|
|
621 |
#if MYSQL_VERSION_ID>=40103 |
622 |
|
623 |
sprintf (query, "DROP DATABASE %s", sql.latin1()); |
624 |
|
625 |
if (mysql_query(&mysql, query) != 0) |
626 |
|
627 |
#else |
628 |
|
608 |
if((mysql_drop_db(&mysql, sql.latin1()))) |
629 |
if((mysql_drop_db(&mysql, sql.latin1()))) |
609 |
|
630 |
|
|
|
631 |
#endif |
632 |
|
610 |
{ |
633 |
{ |
611 |
|
634 |
|
612 |
QMessageBox::critical(this, tr("MySQL Navigator"), QString::fromLocal8Bit(mysql_error(&mysql))); |
635 |
QMessageBox::critical(this, tr("MySQL Navigator"), QString::fromLocal8Bit(mysql_error(&mysql))); |