Jump to content

mactron

Members
  • Content Count

    32
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mactron

  • Rank
    Member
  1. I would like to write all files from specific folder into .txt file. The output working just fine, but I'm getting only one file saved into my txt file. Any idea? Thanks! $fileList = glob('C:\users\John\Documents\*pdf'); foreach($fileList as $filename){ if(is_file($filename)){ echo $filename, '<br>'; $save_files = fopen("list.txt", "w"); fwrite($save_files,$filename); fclose($save_files); } }
  2. Yes I know, but I would like to link to categories also...
  3. Works like a charm, but I can't set the link pointed to the each category based on category id. Among GROUP_CONCAT(), what is another way to resolve the issue? I would be thankful to you if you could provide me some reference. Thanks!!
  4. echo $model->category_id . " " . $model->model_category_name ; ?>
  5. Now I'm getting error in PHP:: Notice: Undefined property: stdClass::$category_id in C:\laragon\www\sys\admin\people.php on line 19 Notice: Undefined property: stdClass::$model_category_name in C:\laragon\www\sys\admin\people.php on line 19
  6. Should I write another query for categories?
  7. Me again.. I'm fetching data from MySQL but each person in people.php is displayed two times instead one.. The issue must be inside models_category_tbl table, because each person have more then one result. Any advice is appreciated. What should I do? I would like to display people something like that: 1 John Doe 1 IT developer, 3 mechanic models/model = person category = occupation/skills MySQL: model_index table +---------+------------+-------------+-------------------+---------------+----------------+ |model_id | model_name | model_title | model_description | model_
  8. From insert query for posts.. $id = $this->conn->lastInsertId(); I would like something like this.. +----+---------+-------------+ | id | post_id | category_id | +----+---------+-------------+ | 1 | 2 | 3 | | 2 | 2 | 5 | | 3 | 3 | 1 | | 4 | 3 | 2 | +----+---------+-------------+ The hole problem is inside my array.
  9. I'm trying to insert array of posts categories into MySQL. I'm getting category IDs from drop down list.. ERR: Notice: Notice: Array to string conversion in C:\laragon\*********\includes\functions.php on line 477 Array Array ( [0] => Array ( [0] => 4 [1] => 5 ) ) PHP try { $sql = "INSERT INTO posts_category_ids (post_id, category_id) VALUES"; $insertQuery = array(); $insertData = array(); foreach ($filter_category as $row) { $insertQuery[] = '(?, ?)';
  10. I'm working on a simple CMS system. So my question is how to add categories of blogs inside database correctly. If I understand EAV I need to add two tables; one table for names, descriptions of categories and one table for categories IDs and posts IDs. I'm correct? Cheers blog_tbl +------+---------+--------+---------------+-------------------+---------+ | b_id | b_title | b_text | b_seo_title | b_seo_description | slug | +------+---------+--------+---------------+-------------------+---------+ | 1 | Title 1 | txt 1 | 70 charsets | 170 charsets | title-1 | |
  11. I will do that way but I'm worried about too many JOINS. I already have 3 queries with 3 JOINS in each.
  12. Ahh I see, another table & another JOIN..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.