www/import/from_brouwhulp.php

changeset 51
7224109adfe1
parent 50
6d94167c2697
child 54
294dda7f1779
equal deleted inserted replaced
50:6d94167c2697 51:7224109adfe1
476 if ($recipe->IBU_METHOD) 476 if ($recipe->IBU_METHOD)
477 $sql .= "', ibu_method='" . mysqli_real_escape_string($db, $recipe->IBU_METHOD); 477 $sql .= "', ibu_method='" . mysqli_real_escape_string($db, $recipe->IBU_METHOD);
478 478
479 if ($recipe->STYLE) { 479 if ($recipe->STYLE) {
480 if ($recipe->STYLE->NAME) 480 if ($recipe->STYLE->NAME)
481 $sql .= "', style_name='" . mysqli_real_escape_string($db, $recipe->STYLE->NAME); 481 $sql .= "', st_name='" . mysqli_real_escape_string($db, $recipe->STYLE->NAME);
482 if ($recipe->STYLE->STYLE_LETTER) 482 if ($recipe->STYLE->STYLE_LETTER)
483 $sql .= "', style_letter='" . mysqli_real_escape_string($db, $recipe->STYLE->STYLE_LETTER); 483 $sql .= "', st_letter='" . mysqli_real_escape_string($db, $recipe->STYLE->STYLE_LETTER);
484 if ($recipe->STYLE->STYLE_GUIDE) 484 if ($recipe->STYLE->STYLE_GUIDE) {
485 $sql .= "', style_guide='" . mysqli_real_escape_string($db, $recipe->STYLE->STYLE_GUIDE); 485 if ($recipe->STYLE->STYLE_GUIDE == "Biertypengids Derek Walsh") {
486 $sql .= "', st_guide='BKG 2015";
487 } else if ($recipe->STYLE->STYLE_GUIDE == "BKG Biertypen") {
488 $sql .= "', st_guide='BKG 2015";
489 } else {
490 $sql .= "', st_guide='" . mysqli_real_escape_string($db, $recipe->STYLE->STYLE_GUIDE);
491 }
492 }
493 if ($recipe->STYLE->OG_MIN)
494 $sql .= "', st_og_min='" . floatval($recipe->STYLE->OG_MIN);
495 if ($recipe->STYLE->OG_MAX)
496 $sql .= "', st_og_max='" . floatval($recipe->STYLE->OG_MAX);
497 if ($recipe->STYLE->FG_MIN)
498 $sql .= "', st_fg_min='" . floatval($recipe->STYLE->FG_MIN);
499 if ($recipe->STYLE->FG_MAX)
500 $sql .= "', st_fg_max='" . floatval($recipe->STYLE->FG_MAX);
501 if ($recipe->STYLE->IBU_MIN)
502 $sql .= "', st_ibu_min='" . floatval($recipe->STYLE->IBU_MIN);
503 if ($recipe->STYLE->IBU_MAX)
504 $sql .= "', st_ibu_max='" . floatval($recipe->STYLE->IBU_MAX);
505 if ($recipe->STYLE->COLOR_MIN) {
506 $srm = floatval($recipe->STYLE->COLOR_MIN);
507 $sql .= "', st_color_min='" . srm_to_ebc($srm);
508 }
509 if ($recipe->STYLE->COLOR_MAX) {
510 $srm = floatval($recipe->STYLE->COLOR_MAX);
511 $sql .= "', st_color_max='" . srm_to_ebc($srm);
512 }
513 if ($recipe->STYLE->CARB_MIN)
514 $sql .= "', st_carb_min='" . floatval($recipe->STYLE->CARB_MIN);
515 if ($recipe->STYLE->CARB_MAX)
516 $sql .= "', st_carb_max='" . floatval($recipe->STYLE->CARB_MAX);
517 if ($recipe->STYLE->ABV_MIN)
518 $sql .= "', st_abv_min='" . floatval($recipe->STYLE->ABV_MIN);
519 if ($recipe->STYLE->ABV_MAX)
520 $sql .= "', st_abv_max='" . floatval($recipe->STYLE->ABV_MAX);
486 } 521 }
487 522
488 /* 523 /*
489 * Put the fermentables in a json array 524 * Put the fermentables in a json array
490 */ 525 */
493 $comma = FALSE; 528 $comma = FALSE;
494 foreach ($recipe->FERMENTABLES->FERMENTABLE as $fermentable) { 529 foreach ($recipe->FERMENTABLES->FERMENTABLE as $fermentable) {
495 if ($comma) 530 if ($comma)
496 $fermentables .= ','; 531 $fermentables .= ',';
497 $comma = TRUE; 532 $comma = TRUE;
498 $fermentables .= '{"name":"' . mysqli_real_escape_string($db, $fermentable->NAME) . '"'; 533 $fermentables .= '{"f_name":"' . mysqli_real_escape_string($db, $fermentable->NAME) . '"';
499 $fermentables .= ',"amount":' . floatval($fermentable->AMOUNT); 534 $fermentables .= ',"f_amount":' . floatval($fermentable->AMOUNT);
500 $fermentables .= ',"cost":' . floatval($fermentable->COST); 535 $fermentables .= ',"f_cost":' . floatval($fermentable->COST);
501 $fermentables .= ',"type":"' . mysqli_real_escape_string($db, $fermentable->TYPE) . '"'; 536 $fermentables .= ',"f_type":"' . mysqli_real_escape_string($db, $fermentable->TYPE) . '"';
502 $fermentables .= ',"yield":' . floatval($fermentable->YIELD); 537 $fermentables .= ',"f_yield":' . floatval($fermentable->YIELD);
503 if ($fermentable->COLOR) { 538 if ($fermentable->COLOR) {
504 $srm = floatval($fermentable->COLOR); 539 $srm = floatval($fermentable->COLOR);
505 $ebc = srm_to_ebc($srm); 540 $ebc = srm_to_ebc($srm);
506 $fermentables .= ',"color":' . $ebc; 541 $fermentables .= ',"f_color":' . $ebc;
507 } 542 }
508 if ($fermentable->COARSE_FINE_DIFF) { 543 if ($fermentable->COARSE_FINE_DIFF) {
509 $fermentables .= ',"coarse_fine_diff":' . floatval($fermentable->COARSE_FINE_DIFF); 544 $fermentables .= ',"f_coarse_fine_diff":' . floatval($fermentable->COARSE_FINE_DIFF);
510 } 545 }
511 if ($fermentable->MOISTURE) { 546 if ($fermentable->MOISTURE) {
512 $fermentables .= ',"moisture":' . floatval($fermentable->MOISTURE); 547 $fermentables .= ',"f_moisture":' . floatval($fermentable->MOISTURE);
513 } 548 }
514 if ($fermentable->DIASTATIC_POWER) { 549 if ($fermentable->DIASTATIC_POWER) {
515 $fermentables .= ',"diastatic_power":' . floatval($fermentable->DIASTATIC_POWER); 550 $fermentables .= ',"f_diastatic_power":' . floatval($fermentable->DIASTATIC_POWER);
516 } 551 }
517 if ($fermentable->PROTEIN) { 552 if ($fermentable->PROTEIN) {
518 $fermentables .= ',"protein":' . floatval($fermentable->PROTEIN); 553 $fermentables .= ',"f_protein":' . floatval($fermentable->PROTEIN);
519 } 554 }
520 if ($fermentable->MAX_IN_BATCH) { 555 if ($fermentable->MAX_IN_BATCH) {
521 $fermentables .= ',"max_in_batch":' . floatval($fermentable->MAX_IN_BATCH); 556 $fermentables .= ',"f_max_in_batch":' . floatval($fermentable->MAX_IN_BATCH);
522 } 557 }
523 if ($fermentable->GRAINTYPE) { 558 if ($fermentable->GRAINTYPE) {
524 $fermentables .= ',"graintype":"' . mysqli_real_escape_string($db, $fermentable->GRAINTYPE) . '"'; 559 $fermentables .= ',"f_graintype":"' . mysqli_real_escape_string($db, $fermentable->GRAINTYPE) . '"';
525 } 560 }
526 if ($fermentable->ADDED) { 561 if ($fermentable->ADDED) {
527 $fermentables .= ',"added":"' . mysqli_real_escape_string($db, $fermentable->ADDED) . '"'; 562 $fermentables .= ',"f_added":"' . mysqli_real_escape_string($db, $fermentable->ADDED) . '"';
528 } 563 }
529 if ($fermentable->DISSOLVED_PROTEIN) { 564 if ($fermentable->DISSOLVED_PROTEIN) {
530 $fermentables .= ',"dissolved_protein":' . floatval($fermentable->DISSOLVED_PROTEIN); 565 $fermentables .= ',"f_dissolved_protein":' . floatval($fermentable->DISSOLVED_PROTEIN);
531 } 566 }
532 ($fermentable->ADJUST_TO_TOTAL_100 == "TRUE") ? $fermentables .= ',"adjust_to_total_100":true' : $fermentables .= ',"adjust_to_total_100":false'; 567 ($fermentable->ADJUST_TO_TOTAL_100 == "TRUE") ? $fermentables .= ',"f_adjust_to_total_100":true' : $fermentables .= ',"f_adjust_to_total_100":false';
533 if ($fermentable->DI_pH) { 568 if ($fermentable->DI_pH) {
534 $fermentables .= ',"di_ph":' . floatval($fermentable->DI_pH); 569 $fermentables .= ',"f_di_ph":' . floatval($fermentable->DI_pH);
535 } 570 }
536 $fermentables .= "}"; 571 $fermentables .= "}";
537 } 572 }
538 573
539 $fermentables .= ']'; 574 $fermentables .= ']';
551 $comma = FALSE; 586 $comma = FALSE;
552 foreach ($recipe->HOPS->HOP as $hop) { 587 foreach ($recipe->HOPS->HOP as $hop) {
553 if ($comma) 588 if ($comma)
554 $hops .= ','; 589 $hops .= ',';
555 $comma = TRUE; 590 $comma = TRUE;
556 $hops .= '{"name":"' . mysqli_real_escape_string($db, $hop->NAME) . '"'; 591 $hops .= '{"h_name":"' . mysqli_real_escape_string($db, $hop->NAME) . '"';
557 $hops .= ',"amount":' . floatval($hop->AMOUNT); 592 $hops .= ',"h_amount":' . floatval($hop->AMOUNT);
558 $hops .= ',"cost":' . floatval($hop->COST); 593 $hops .= ',"h_cost":' . floatval($hop->COST);
559 $hops .= ',"type":"' . mysqli_real_escape_string($db, $hop->TYPE) . '"'; 594 $hops .= ',"h_type":"' . mysqli_real_escape_string($db, $hop->TYPE) . '"';
560 $hops .= ',"form":"' . mysqli_real_escape_string($db, $hop->FORM) . '"'; 595 $hops .= ',"h_form":"' . mysqli_real_escape_string($db, $hop->FORM) . '"';
561 $hops .= ',"use":"' . mysqli_real_escape_string($db, $hop->USE) . '"'; 596 $hops .= ',"h_use":"' . mysqli_real_escape_string($db, $hop->USE) . '"';
562 if ($hop->TIME) 597 if ($hop->TIME)
563 $hops .= ',"time":' . floatval($hop->TIME); 598 $hops .= ',"h_time":' . floatval($hop->TIME);
564 $hops .= ',"alpha":' . floatval($hop->ALPHA); 599 $hops .= ',"h_alpha":' . floatval($hop->ALPHA);
565 $hops .= ',"beta":' . floatval($hop->BETA); 600 $hops .= ',"h_beta":' . floatval($hop->BETA);
566 $hops .= ',"hsi":' . floatval($hop->HSI); 601 $hops .= ',"h_hsi":' . floatval($hop->HSI);
567 $hops .= ',"humulene":' . floatval($hop->HUMULENE); 602 $hops .= ',"h_humulene":' . floatval($hop->HUMULENE);
568 $hops .= ',"carophyllene":' . floatval($hop->CAROPHYLLENE); 603 $hops .= ',"h_carophyllene":' . floatval($hop->CAROPHYLLENE);
569 $hops .= ',"cohumulone":' . floatval($hop->COHUMULONE); 604 $hops .= ',"h_cohumulone":' . floatval($hop->COHUMULONE);
570 $hops .= ',"myrcene":' . floatval($hop->MYRCENE); 605 $hops .= ',"h_myrcene":' . floatval($hop->MYRCENE);
571 if ($hop->TOTAL_OIL) 606 if ($hop->TOTAL_OIL)
572 $hops .= ',"total_oil":' . floatval($hop->TOTAL_OIL); 607 $hops .= ',"h_total_oil":' . floatval($hop->TOTAL_OIL);
573 $hops .= "}"; 608 $hops .= "}";
574 } 609 }
575 610
576 $hops .= ']'; 611 $hops .= ']';
577 // echo $hops . PHP_EOL; 612 // echo $hops . PHP_EOL;
588 $comma = FALSE; 623 $comma = FALSE;
589 foreach ($recipe->MISCS->MISC as $misc) { 624 foreach ($recipe->MISCS->MISC as $misc) {
590 if ($comma) 625 if ($comma)
591 $miscs .= ','; 626 $miscs .= ',';
592 $comma = TRUE; 627 $comma = TRUE;
593 $miscs .= '{"name":"' . mysqli_real_escape_string($db, $misc->NAME) . '"'; 628 $miscs .= '{"m_name":"' . mysqli_real_escape_string($db, $misc->NAME) . '"';
594 $miscs .= ',"amount":' . floatval($misc->AMOUNT); 629 $miscs .= ',"m_amount":' . floatval($misc->AMOUNT);
595 if ($misc->COST) 630 if ($misc->COST)
596 $miscs .= ',"cost":' . floatval($misc->COST); 631 $miscs .= ',"m_cost":' . floatval($misc->COST);
597 $miscs .= ',"type":"' . mysqli_real_escape_string($db, $misc->TYPE) . '"'; 632 $miscs .= ',"m_type":"' . mysqli_real_escape_string($db, $misc->TYPE) . '"';
598 $miscs .= ',"use":"' . mysqli_real_escape_string($db, $misc->USE) . '"'; 633 $miscs .= ',"m_use":"' . mysqli_real_escape_string($db, $misc->USE) . '"';
599 ($misc->AMOUNT_IS_WEIGHT== "TRUE") ? $miscs .= ',"amount_is_weight":true' : $miscs.= ',"amount_is_weight":false'; 634 ($misc->AMOUNT_IS_WEIGHT== "TRUE") ? $miscs .= ',"m_amount_is_weight":true' : $miscs.= ',"m_amount_is_weight":false';
600 if ($misc->TIME) 635 if ($misc->TIME)
601 $miscs .= ',"time":' . floatval($misc->TIME); 636 $miscs .= ',"m_time":' . floatval($misc->TIME);
602 $miscs .= "}"; 637 $miscs .= "}";
603 } 638 }
604 639
605 $miscs .= ']'; 640 $miscs .= ']';
606 // echo $miscs . PHP_EOL; 641 // echo $miscs . PHP_EOL;
617 $comma = FALSE; 652 $comma = FALSE;
618 foreach ($recipe->YEASTS->YEAST as $yeast) { 653 foreach ($recipe->YEASTS->YEAST as $yeast) {
619 if ($comma) 654 if ($comma)
620 $yeasts .= ','; 655 $yeasts .= ',';
621 $comma = TRUE; 656 $comma = TRUE;
622 $yeasts .= '{"name":"' . mysqli_real_escape_string($db, $yeast->NAME) . '"'; 657 $yeasts .= '{"y_name":"' . mysqli_real_escape_string($db, $yeast->NAME) . '"';
623 $yeasts .= ',"amount":' . floatval($yeast->AMOUNT); 658 $yeasts .= ',"y_amount":' . floatval($yeast->AMOUNT);
624 if ($yeast->COST) 659 if ($yeast->COST)
625 $yeasts .= ',"cost":' . floatval($yeast->COST); 660 $yeasts .= ',"y_cost":' . floatval($yeast->COST);
626 $yeasts .= ',"laboratory":"' . mysqli_real_escape_string($db, $yeast->LABORATORY) . '"'; 661 $yeasts .= ',"y_laboratory":"' . mysqli_real_escape_string($db, $yeast->LABORATORY) . '"';
627 $yeasts .= ',"product_id":"' . mysqli_real_escape_string($db, $yeast->PRODUCT_ID) . '"'; 662 $yeasts .= ',"y_product_id":"' . mysqli_real_escape_string($db, $yeast->PRODUCT_ID) . '"';
628 $yeasts .= ',"type":"' . mysqli_real_escape_string($db, $yeast->TYPE) . '"'; 663 $yeasts .= ',"y_type":"' . mysqli_real_escape_string($db, $yeast->TYPE) . '"';
629 $yeasts .= ',"form":"' . mysqli_real_escape_string($db, $yeast->FORM) . '"'; 664 $yeasts .= ',"y_form":"' . mysqli_real_escape_string($db, $yeast->FORM) . '"';
630 ($yeast->AMOUNT_IS_WEIGHT== "TRUE") ? $yeasts .= ',"amount_is_weight":true' : $yeasts.= ',"amount_is_weight":false'; 665 ($yeast->AMOUNT_IS_WEIGHT== "TRUE") ? $yeasts .= ',"y_amount_is_weight":true' : $yeasts.= ',"y_amount_is_weight":false';
631 if ($yeast->ADD_TO_SECONDARY=="FALSE") { 666 if ($yeast->ADD_TO_SECONDARY=="FALSE") {
632 $yeasts .= ',"use":"Primary"'; 667 $yeasts .= ',"y_use":"Primary"';
633 } else if ($yeast->PRODUCT_ID=="F2") { 668 } else if ($yeast->PRODUCT_ID=="F2") {
634 $yeasts .= ',"use":"Bottle"'; 669 $yeasts .= ',"y_use":"Bottle"';
635 } else { 670 } else {
636 $yeasts .= ',"use":"Secondary"'; 671 $yeasts .= ',"y_use":"Secondary"';
637 } 672 }
638 $yeasts .= "}"; 673 $yeasts .= "}";
639 } 674 }
640 675
641 $yeasts .= ']'; 676 $yeasts .= ']';
653 $comma = FALSE; 688 $comma = FALSE;
654 foreach ($recipe->WATERS->WATER as $water) { 689 foreach ($recipe->WATERS->WATER as $water) {
655 if ($comma) 690 if ($comma)
656 $waters .= ','; 691 $waters .= ',';
657 $comma = TRUE; 692 $comma = TRUE;
658 $waters .= '{"name":"' . mysqli_real_escape_string($db, $water->NAME) . '"'; 693 $waters .= '{"w_name":"' . mysqli_real_escape_string($db, $water->NAME) . '"';
659 $waters .= ',"amount":' . floatval($water->AMOUNT); 694 $waters .= ',"w_amount":' . floatval($water->AMOUNT);
660 if ($water->CALCIUM) 695 if ($water->CALCIUM)
661 $waters .= ',"calcium":' . floatval($water->CALCIUM); 696 $waters .= ',"w_calcium":' . floatval($water->CALCIUM);
662 if ($water->BICARBONATE) 697 if ($water->BICARBONATE)
663 $waters .= ',"bicarbonate":' . floatval($water->BICARBONATE); 698 $waters .= ',"w_bicarbonate":' . floatval($water->BICARBONATE);
664 if ($water->SULFATE) 699 if ($water->SULFATE)
665 $waters .= ',"sulfate":' . floatval($water->SULFATE); 700 $waters .= ',"w_sulfate":' . floatval($water->SULFATE);
666 if ($water->CHLORIDE) 701 if ($water->CHLORIDE)
667 $waters .= ',"chloride":' . floatval($water->CHLORIDE); 702 $waters .= ',"w_chloride":' . floatval($water->CHLORIDE);
668 if ($water->SODIUM) 703 if ($water->SODIUM)
669 $waters .= ',"sodium":' . floatval($water->SODIUM); 704 $waters .= ',"w_sodium":' . floatval($water->SODIUM);
670 if ($water->MAGNESIUM) 705 if ($water->MAGNESIUM)
671 $waters .= ',"magnesium":' . floatval($water->MAGNESIUM); 706 $waters .= ',"w_magnesium":' . floatval($water->MAGNESIUM);
672 if ($water->PH) 707 if ($water->PH)
673 $waters .= ',"ph":' . floatval($water->PH); 708 $waters .= ',"w_ph":' . floatval($water->PH);
674 if ($water->TOTAL_ALKALINITY) 709 if ($water->TOTAL_ALKALINITY)
675 $waters .= ',"total_alkalinity":' . floatval($water->TOTAL_ALKALINITY); 710 $waters .= ',"w_total_alkalinity":' . floatval($water->TOTAL_ALKALINITY);
711 if ($water->COST)
712 $waters .= ',"w_cost":' . floatval($water->COST);
713 else
714 $waters .= ',"w_cost":0.00';
715 ($water->DEFAULT_WATER== "TRUE") ? $waters .= ',"w_default_water":true' : $waters.= ',"w_default_water":false';
676 $waters .= "}"; 716 $waters .= "}";
677 } 717 }
678 718
679 $waters .= ']'; 719 $waters .= ']';
680 // echo $waters . PHP_EOL; 720 // echo $waters . PHP_EOL;
685 725
686 /* 726 /*
687 * Put the mash in a json array 727 * Put the mash in a json array
688 */ 728 */
689 if ($recipe->MASH) { 729 if ($recipe->MASH) {
690 $mash = '{"sparge_temp":' . floatval($recipe->MASH->SPARGE_TEMP); 730 $sql .= "',mash_sparge_temp='" . floatval($recipe->MASH->SPARGE_TEMP);
691 $mash .= ',"ph":' . floatval($recipe->MASH->PH); 731 $sql .= "',mash_ph='" . floatval($recipe->MASH->PH);
692 if ($recipe->MASH->NAME) 732 if ($recipe->MASH->NAME)
693 $mash .= ',"name":"' . mysqli_real_escape_string($db, $recipe->MASH->NAME) . '"'; 733 $sql .= "',mash_name='" . mysqli_real_escape_string($db, $recipe->MASH->NAME);
734
694 if ($recipe->MASH->MASH_STEPS) { 735 if ($recipe->MASH->MASH_STEPS) {
695 $steps = ',"mash_steps":['; 736 $steps = '[';
696 $comma = FALSE; 737 $comma = FALSE;
697 foreach ($recipe->MASH->MASH_STEPS->MASH_STEP as $step) { 738 foreach ($recipe->MASH->MASH_STEPS->MASH_STEP as $step) {
698 if ($comma) 739 if ($comma)
699 $steps .= ','; 740 $steps .= ',';
700 $comma = TRUE; 741 $comma = TRUE;
701 $steps .= '{"step_name":"' . mysqli_real_escape_string($db, $step->NAME) . '"'; 742 $steps .= '{"step_name":"' . mysqli_real_escape_string($db, $step->NAME) . '"';
702 if ($step->TYPE) { 743 if ($step->TYPE)
703 $steps .= ',"step_type":"' . $step->TYPE . '"'; 744 $steps .= ',"step_type":"' . $step->TYPE . '"';
704 } 745 if ($step->INFUSE_AMOUNT)
705 if ($step->STEP_TEMP) { 746 $steps .= ',"step_infuse_amount":"' . floatval($step->INFUSE_AMOUNT) . '"';
706 $steps .= ',"step_temp":"' . $step->STEP_TEMP . '"'; 747 if ($step->STEP_TEMP)
707 } 748 $steps .= ',"step_temp":"' . floatval($step->STEP_TEMP) . '"';
708 if ($step->STEP_TIME) { 749 if ($step->STEP_TIME)
709 $steps .= ',"step_time":"' . $step->STEP_TIME . '"'; 750 $steps .= ',"step_time":"' . floatval($step->STEP_TIME) . '"';
710 } 751 if ($step->RAMP_TIME)
711 if ($step->RAMP_TIME) { 752 $steps .= ',"ramp_time":"' . floatval($step->RAMP_TIME) . '"';
712 $steps .= ',"ramp_time":"' . $step->RAMP_TIME . '"'; 753 if ($step->END_TEMP)
713 } 754 $steps .= ',"end_temp":"' . floatval($step->END_TEMP) . '"';
714 if ($step->END_TEMP) {
715 $steps .= ',"end_temp":"' . $step->END_TEMP . '"';
716 }
717 $steps .= "}"; 755 $steps .= "}";
718 } 756 }
719 $steps .= ']'; 757 $steps .= ']';
720 $mash .= $steps; 758 // echo $steps . PHP_EOL;
721 } 759 $sql .= "', json_mashs='" . $steps;
722 760 if (strlen($steps) > $len_mash)
723 $mash .= '}'; 761 $len_mash = strlen($steps);
724 // echo $mash . PHP_EOL; 762 }
725 $sql .= "', json_mash='" . $mash;
726 if (strlen($mash) > $len_mash)
727 $len_mash = strlen($mash);
728 } 763 }
729 764
730 $sql .= "';"; 765 $sql .= "';";
731 if (! $result = mysqli_query($db, $sql)) { 766 if (! $result = mysqli_query($db, $sql)) {
732 printf("Error: %s\n", mysqli_error($db)); 767 printf("Error: %s\n", mysqli_error($db));

mercurial