Hello, Please help! I would like use different Mysql db with one instalation !? so far my project is simple cash flow for different shops, it is ready installed on server, works fine for one shop only! but I have 22 shops, I don't want 22 installations, they should use different db, as they don't need to see each other... so I have 22 same structure data bases and one installation... So i have made drop down menu in index file just before log in, in order to change db name in config.php : define("DB_NAME", "cashflow_1"); result is Notice: Constant DB_NAME already defined in ... so I have that problem as once constant is defined we can't change it !
So I have that fight for few days, I have try so far to change hole config.php, it makes some other issues, I have try undefine, I have no full control of that server, so that php plugin is not an option, I have try true and false statment for define... I have try delete from config.php and put in PDOdb.php my own variable... but I'm doing something wrong please advice? other ideas, that could solve that? or Where to put my variable $db_name to make it work?
Hello, Before a year I create small project with PHPrad 2.7.3, I needed only login Authentication and I was happy! Now I decided to make my project more open so I make some pages to be seen by guest ! In Authentication I marked pages that no require user Authentication(guest) ... it works by direct link!
the problem : I was expecting to see menu with those pages + login link and completely different home page! How to create a menu for that guest? Did I miss something? Is there an easy way or I should do menu/guest/home/etc pages my self ?
New version of phprad - is there a guest section? what to expect ? When is coming?
@willvin Maybe my explain was poor, I will try again! search is working but very bad! It search by one word only! yes in all columns and all rows! but if you search by 2 or more words, and if combination exist in a one field it will return result, but if combination is in more fields it will return "No record found"
what I mean I have table with 1000 rows, simple table few column only: id | name | position | salary | month| year| date
so I want to find specific rows by searching: John 2018 result I get is "No record found", the result should return: 12 rows
@willvin Hi, I have a form add.php, there is few calculation have to be made and should be confirmed before real submit/inserting in a db so I make one additional button with name='update', then in page events before add I put the code: if(isset($_POST['update'])){ $fields = array("doc" => $_POST['doc'], "test" => "11111111111111111111111", "uprice" => $_POST['uprice'], "qty" => $_POST['qty'], "total"=> $_POST['uprice']* $_POST['qty'] ); return $this->redirect("docs/add"); } The idea is to update those values from the array in the form add.php! How to display it in add.php?
The blank in print and pdf it is probably due to some charts that is not readable by the print convertor see this link, last 2 replies: https://phprad.com/forum/index.php?topic=743.msg2479#msg2479 for long list, Brienen is right, for now there is no option export ALL from the list
<?php //single row: $company_id=$cid; $cmtcc = new CompanyController; $db = $cmtcc->GetModel(); //execute SQL statement and return a single row $params = array($company_id); $array = $db->rawQuery("SELECT * FROM company WHERE id = ?", $params); $company=$array['0']; ?> <br <?php echo $company['company']; ?> <br> <?php echo (ucwords($company['vat'])); ?> //etc.... <? //many rows // one way in my case $products_in_cart is an array with a product_ids and quantitys
// the above code is simple but could crash, so it is better to call the db array first then the loop as: $params = array($products_in_cart); $arr = $db->rawQuery("SELECT * FROM product WHERE id IN (?)", $params );
From few days I can't figure out the following: I want to call array in add.php!
code: // in page event before add: ...... if(isset($_POST['update'])){ $fields = array("doc" => $_POST['doc'], "test" => "11111111111111111111111" ); $this->set_flash_msg(get_lang('UPDATED! '), "success"); return $this->redirect("docs/add"); } ..... //in add.php I have try so much different options in controller and add.php as: $modeldata['test']; $data = $this->view_data; request, view_data, $data['test'], I even make my own view functions and etc... and No it didn't work... due to some reasons, it clear the array and display blank: and gives Notice: Trying to access array offset … or print_r gives blank array etc... I call the controller to display other arrays from DB as well, that seems to be the main issue... as that calls are bellow in page, and mayby that is what clears my $post['update'] data?
Please advice, how to call this array in add page? <?php // I want to call it this in add.php echo fields['doc']; echo fields['test'];