-
Posts
293 -
Joined
-
Last visited
-
Days Won
5
Everything posted by jodunno
-
hmm, i think that preg_match_all should have three parameters: preg_match_all ($pattern, $subject, $matches) the posted code only contains $pattern and $subject (2/3). preg_match_all( "/$needle/im", $haystack ) php manual entry for preg match all most helpful text from the php manual: "Searches subject for all matches to the regular expression given in pattern and puts them in matches in the order specified by flags." maybe i am wrong but i think that a proper parameter count will solve the problem.
-
you really are a fantastic programmer. You work very quickly, so it is obvious that coding is second nature to you. I have alot to learn before i could reach such a level. I cannot thank you enough for spending time on this subject. I was pulling my hair out trying to get it to work. Your code makes much more sense. I will add my species list to your table design and try it out tomorrow. I'm going to bed soon. I've sent a zip file to you with some of my routing code that uses my taxonomical arrays. The router just explodes the path to check for a rank. I then use a rank and name array so the page knows what it is (latin and vernacular). I believe my arrays are actually called $yourRank and $yourName. So each traversal through the file system can ask what it is and recieve an answer. I can show you the code if you need to see how it works. Anyway, i'll try this tomorrow. Sleep well, Barand and please stay healthy. I hate this corona stuff that we all have to deal with.
-
i only maintain a latin (scientific) name with a German translation (if one exists in vernacular form). Alot of insects do not have a common name. I live in Berlin, so German is the default language of the system. I wanted to add English since it is my native language but it does not exist in my flat files at this time. So English is being added to search table. I try to add both American and British English whenever possible. I suppose that it might be easier to use my flat files for this data? I will zip some of my code for you to look at, so you can see how my site is working. Code will answer more questions than i can answer. I'll show you how my router works based upon the flat file system. I was going to convert it to a db but it was easier to continue with a functional approach because php has more power than sql. For example, if else. I kept the functional approach for this reason and because i am really new to database design. I can only issue basic commands using sql. join is beyond me right now. But again, my functions work very well and quickly and i have more power over the data with php. Thus, i keep using them instead of a db. originally, i had folders and files (static pages of html/css only). I experimented with php and ended up with a routing system which depends upon arrays. I never tweaked the arrays to something smaller and easier like numbers. My goal was to eliminate files and folders. I've accomplished this goal. Anyway, many keywords are not in the arrays used to fill the template with selections. I'd have to add multi-dimensional arrays for other languages. it may be easier to show you code. I'll email some scriots to you, if it is okay to do so.
-
I am trying to build the table of birds for search keywords and it is brutal. I've spent two hours now and i only have 15 species entered of 79. While building this list i wondered if it would be faster to make a large array in cpp and use that instead. Then i got an idea for a cache system. Instead of building a database, how about i build a cache folder with every possible keyword as a file with pre determined results? wouldn't that be fast and easy? so cache folder has meise.php meisen.php and soundexmeise.php and soundexmeisen.php since i am manually building this list i think it would be better than using a slow and sluggish database. what do you think? search meise and if file exists searchterm.php then show file with manually entered matches.
-
I made a video of my site but it is 163mb and too large to attach to email from Google. I'll try to add two screen captures, nay, resized screen captures. I hope that they are small enough to attach here. I've spent alot of time on the front end trying to avoid the cookie cutter designs. anytime i mention photos and trying to protect my hard work, people automatically think that my photo driven site is porn or something. LOL I had some things/designs in mind when i began the site: photo backgrounds that can be disabled, background tint that can be changed and strength can be changed, language options, bookmarks (browsers have no business knowing what your customers are looking at. my pages are protected, so i offer a bookmarking system which also stops browsers from aiding yet more espionage), i wanted a search feature but i'm struggling with this concept, i recently imagined my sticky notes being private messages (which you all ready know about) and i wanted to keep all of my photos and data outside of the root directory. I've managed to accomplish most of these tasks on my own.
-
yes, i'm making a nature porn website. I'm hoping to have a million bird subscribers. 😄 I think that i'll call my site "feather fantasy". LOL Birds are easy to id in most cases. Flies, spiders and beetles pose a big problem most of the time. If you ever start photographing nature you will learn that many insects cannot be identified by photo, which sucks. You may have an award winning photo but no id for the subject. Experts will often tell you species sp. I started studying this subject and i managed to teach myself how to dissect and identify my own subjects. Sometimes i need experts to confirm my id. I will attach an example of fly porn: a male Helina pertusa
-
I have one thousand one hundred species documented (photos, genitalia, confirmation from experts, data and measurements). Building my site prevents me from working on nature. Anyway, i don't use a database for retrieving species. I use alphabetic functions which return arrays to load each rank. I don't have actual php files per species. I use one file to load all species based upon the flat file functions. I avoid using a database for every little aspect of the site to avoid locking and overruse. My alphabetic/targeted approach is working faster than a db. I use the db to verify that you are a logged in user and match your db session id with your session id instead. In order to use a search, i'll have to build a search table. I actually narrow the alphabetic approach to the first three letters of the target. So Aves will be found in function file A under function Ave. Lightning fast retrieval and better than a db. Best wishes.
-
Hi Barand, I don't think it is exaggeration since we are talking about internet usage. People/website users think a second too long is a second too long. I was just confused because my queries were working fast on xampp. Anyway, i've removed this code and started over. the taxonomy table is very small for search testing. I now only have Cyanistes caeruleus in the table. I've started over. I will build a bigger table for experimentation and send it to you. Meantime, my website started out as static html/css. I decided to take it to the server side using php. I started studying php two years ago in my spare time. I have acquired alot of knowledge since then but i am still a novice. I just don't know how certain tasks are accomplished in this industry. Anyway, i have a species list for each major class. I use it on my publicly non-logged in pages for prospective members to see which species i have documented. I can also send a copy of these lists to you. I mean, if there is any significance in doing so. Otherwise, please allow me to build a bigger table. I will send the code and also a dump of the database for you. You would probably shriek if you saw my entire website code. LOL I use my own router based upon post methods. I do alot of things that coders hate. For example, i use the session to store image names for loading on a page so that images cannot be viewed unless the variable is set. You'd probably lay an egg looking at that code alone. I also keep my taxonomical navigator private with prg posts instead of uris with get requests. You'd probably faint if you saw it. So i will stick to the relevant code for critique. I will build my table tommorrow. I am very tired today and i will go to bed soon. Thank you for guiding me in the right direction. As a wanna-be coder, it is very nice to have a master coder offer advice and guidance. Really, i appreciate every word that you type to me. Best wishes. Stay healthy and happy.
-
Hi Barand, your opinion is trusted, naturally, i just wonder what you mean by finish by breakfast since my results are instantaneous on xampp. I assume that you mean lots of users? anyway, i heed your advice and remove the current code. I have started over with full text and match against, like so: CREATE TABLE taxonomy (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(128), link VARCHAR(128), keywords TEXT, FULLTEXT (keywords)) ENGINE=InnoDB; INSERT INTO taxonomy SET title = 'Cyanistes caeruleus', link = 'path/to/sp', keywords = CONCAT ('Cyanistes caeruleus blau meise meisen blaumeise blaumeisen blue tit tits bluetits bluechickadees chickadee chickadees',' ',soundex('Cyanistes'),' ',soundex('caeruleus'),' ',soundex('blau'),' ',soundex('meise'),' ',soundex('meisen'),' ',soundex('blaumeise'),' ',soundex('blaumeisen'),' ',soundex('blue'),' ',soundex('tit'),' ',soundex('tits'),' ',soundex('bluetits'),' ',soundex('bluechickadees'),' ',soundex('chickadee'),' ',soundex('chickadees')); $keyword = (string) $_POST['suchworte']; $skeyword = (string) soundex($_POST['suchworte']); $searchQuery = 'SELECT title, link FROM taxonomy WHERE match(keywords) against(:keyword) or match(keywords) against(:skeyword)'; it is working but i have to add all of the keywords and soundex values. is this method better? ps: i romanize German, id est, u with umlaut is ue. Thus, soundex is working just fine for me. I really have no complaints. I suppose that they mean non romanized languages? Best wishes.
-
Hello again, I've had an exhausting, stressful week but i managed to tinker with my simple name search feature. For some reason, MATCH AGAINST full-text searches failed me. So i redesigned my table with id, title, link, keywords. keywords is varchar(255), which contains a small list of names for a species in plural form as one word (no spaces). I also discovered the soundex() method of searching for misspelled word matches. I combined like and soundex to get the results that i was seeking. so as an example of my current test code: $title = (string) '%' . $_POST['search'] . '%'; $keyword = (string) '%' . str_replace(' ', '', $_POST['search']) . '%'; $stitle = $skeyword = (string) '%' . soundex($_POST['search']) . '%'; $Query = 'SELECT title, link FROM taxonomy WHERE title LIKE :title or title LIKE :stitle or keywords LIKE :keyword or keywords LIKE :skeyword'; and an example of my table data: title: Parus major link: path/to/Parus/major keywords: Parus major Kohlmeisen Coaltits soundex('Parus') soundex('major') soundex('Kohlmeisen') soundex('Coaltits') soundex('Kohl') soundex('meisen') soundex('coal') now i wonder if this is too complicated and searches will slow down my website? i just want to add a very basic/primitive/simple search feature. i really don't like java and i am not interested in using the free java based search engines like Lucene, Solr etc. besides, i am not indexing pages. I all ready maintain a manually edited.controlled species list. i just want the species list to be searchable. is this new code okay? any suggestions? any criticism? call me a stupid loser for all i care, just please explain why this method is bad/negative and how could i make it better? so far it is working well for me. I can type meisen and all entries appear. I can also type maisen and get the same results via soundex. I like it but i am nescient about this subject. Thank you.
-
Hi requinix, I'm actually happy that I can offer a basic search for taxonomy using a database. I am not an advanced programmer yet so building an indexer is not my goal. I simply desire a list of all of the species that i have photographed and identified via genitalia. I currently have over 1,100 species. Thus, i think that a simple keyword list with a link is good. I don't understand why you object to using a database for such a simple search other than because of memory consumption(?). I use Latin (scientific nomenclature), English and German languages. My reason for posting is because plural searches yield no results. Other than that, i am happy that i am getting results at all. I entered a few examples into a table for testing: Turdus merula link/to/file, Turdus philomelos link/to/file, Blaumeise link/to/file, Kohlmeise link/to/file etc. typing turdus brings up both merula and philomelos which is good. typing meise brings up both Blaumeise and Kohlmeise. However, typing meisen yields my no results catch (if empty($results))). I just wanted to be able to support plural forms. I'm definitely interested in learning how to build a search engine and also in becoming an advanced coder. Such desires could become a reality one day but definitely not anytime so soon. Best wishes, requinix. Hi Barand, That is great! Thank you for adding this data. I will recode my simple search query and enjoy the new results. I was wondering if building a separate database for searches is a good idea or not. I say this because i think that i could make searching faster by adding a table for all letters of the alphabet. Then, take first letter of search term and narrow the field to a single table. Like a dictionary with lettered thumb indexes. Go right to the relevant letter and spare the database resource consumption. yes? no? just an idea. I have to go now. Best wishes to all!
-
Hello everyone, I am wondering if anyone can offer tips for dealing with plural forms of words in searches? l was wondering if boolean mode is simply the answer or if i should implement a keywords column which contains a list of keywords including plurals to be searched with like? I simply wish to find the database entry (which is in singular form) when a user searches for a plural form (user searches for meisen but title column houses meise). Best wishes
-
Dear Barand, Brilliant! Thank you for the design model and the user id tip to avoid display name issues. I will work on a test mail system and see how it goes as a rough draft. I think that maybe i should call this messaging system notes instead of mail to avoid confusion with real email systems. Private Notes with individual/self, friends or group settings. File upload is easy enough (although security is complicate and delicate.) I will also implement soft deletions and copyright infringement blocks. File uploading will have to deal with all of the legal issues that accompany the process for sure. I will start working on this design sometime today. I'm currently adjusting my bookmark system because i use a one hit history for taxonomical browsing. bookmarks overwrite the history and i want to avoid this overwriting. Thus, i am setting a variable to detect that a bookmark was used to access the rank which in turn avoids rewriting history. I guess a good name for it is paradox variable. if paradox then do not log history. The onetime history is to make it easy to return to your last view in the taxonomical browser. Anyway, I will adjust this bookmark problem, then start working on the Note system. Thank you and Best wishes. ps you are so Brilliant with databases. You make it seem so simple.
-
Hello to all, I have an idea for my website but i am hoping to have some design tips from experienced members. I am not a programmer or a database designer. I am not asking for code as i am capable of coding with pseudocode guides. I am not sure how to properly implement my ideas. here is my idea and necessary site data: i have a member application for taxonomy (nature, meaning that i identify animals by keys or dissection and i am providing my own biological research material for all of the ranks that i have documented to date.) I ask for application login name and password, then a separate display name (i don't want your login name used anywhere on my site. it is only for application access.) The screen name can be changed (poses a problem with my idea, so i need a solution for handling the problem, which i will mention below). I want to add a mail box which is not public like an email provider. This is more like a private messaging system. I will call it post and your messages will be displayed as sticky notes with titles that are clickable to the full message/note. The only way to use this private mail system is to manually add display names that you trust to a friend list. Once a friend is added by screen name, then you can accept and send messages to this person. Some messages can be notes for your own viewing (not available to friends, thus i suppose a db column flag is appropriate, such as column named privatenote- = yes/no, 1/0 etc). then i would like to add a "group" feature where the messages are visible in a group page/tab. The site is private but these notes are visible to all in the group like a public gathering/meeting. then i would like to allow file uploads for sharing data. For example, a scientist may join my site and offer a research paper for download to anyone in his/her friend list. a problem with adding friends to a list is that i use the display name which can be changed. so i need to be able to update all friend lists if a member changes his/her display name. so i am wondering how to design such a database or do i just make tables in my current members database which also holds a bookmarks table. anyone willing to offer advice for such a feature? Best wishes.
-
Hi gizmola, I typically do not understand certain mysqli code and i usually ignore it. I am happy with pdo and pdo is usually suggested by experts, like you, anyway. Meantime, i should also explain my code and repost it. You may notice a break(2) and wonder why it exists, for example. My code acually contains a switch based upon a form post. I keep all of my bookmark db code in one file (bookmarksdb). I have a page to display all bookmarks (case 'select'), a page method to add a bookmark on bookmarkable pages (case 'insert') and a page to delete bookmarks from your bookmarks list (case 'delete'). I also use a counter case which simply returns the count ($result['total']). The counter (case 'count') is used as a small circle that holds the count of bookmarks to be displayed at the top right div of the bookmarks page icon. I use it like a phone apps new messages bubble beside app icons. Thus, the icon count bubble will inform you how many bookmarks you have to avoid a need to view the bookmarks page just for this info. <?php declare (strict_types = 1); $dbhost = '127.0.0.1'; $dbname = 'test'; $dbuser = 'root'; $dbpass = ''; $dbattr = array(PDO::ATTR_EMULATE_PREPARES => false,PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC); try { $connection = new PDO("mysql:host=$dbhost; dbname=$dbname; charset=utf8mb4", $dbuser, $dbpass, $dbattr); } catch (PDOException $e) { error_log($e->getMessage()); } $query = 'SELECT count(*) as total FROM bookmarks WHERE uid = :uid'; $stmt = $connection->prepare($query); $stmt->execute(array(':uid' => $uid)); $result = $stmt->fetch(); switch ($action) { //$action is known by session array key which holds the csrf token of the form field posted case 'delete': //code to delete a bookmark, which relies upon !empty($result['total']) break; case 'insert': if ($result['total'] < 100) { $query = 'SELECT link FROM bookmarks WHERE uid = :uid'; $stmt = $connection->prepare($query); $stmt->execute(array(':uid' => $uid)); while ($column = $stmt->fetch()) { if ($column['link'] === $link) { $duplicate = true; break(2); } } $query = 'INSERT into bookmarks (uid, type, link, icon, label, date) VALUES (:uid, :type, :link, :icon, :label, NOW())'; $stmt = $connection->prepare($query); $stmt->execute(array(':uid' => $uid, et cetera...)); } break; } I still don't know how to handle errors from the other queries. I don't want my site to break and a white page to be shown with error data. I prefer that my site remain visible and i display the error and not the software. I have no idea how to do this yet. anyway, Thank you for the info in this thread. I appreciate everyone taking time to help me. Like i said before, i am not delusional about my status here. I am not a programmer at all. I am street smart for sure and able to code despite no education in this field. I sometimes do things correctly and many times just get something to work. No matter what, i always appreciate professionals offering inside advice. I sometimes wish hackers would dump source code to big tech company websites so i can truly learn how the pros do it. I enjoy coding when i can do it correctly but i lack so much info about this industry. I often have to employ street smarts to bring a concept to life. I have no programming friends so i never receive inside intel about 'how the pros code common ideas'. ok, too much babbling and i far too much work to do today. Off i go... Best wishes.
-
Hello gizmola and benanamen, Thank you for the informative replies. I did not know that one can "enforce uniqueness on a user/link basis". I am nescient about sql. I will have to drop my table and rebuild it now. I don't mind an extra query if there is no other way but clearly you know of a better way. I will drop the table and add the new unique constraint. Thank you for this valuable info!!! I should've expressed my desires clearly. My apologies for any vagueness in this thread. Your assumptions are correct about unique links per user. I just want to allow bookmarks but not duplicate entries for each user. I am excited to learn how to do this properly. I doff my hat to you! Thank you. I use pdo. I just started studying php two years ago in my spare time. I never learned mysqli. I made my first login script two years ago using pdo. Thus, i only know pdo. my code is slightly different than the following but only by variable names. I clean it up for posting here because some people just insist on doing things their way. such as, naming db variable $conn, $stmt etc. I use my own names. <?php declare (strict_types = 1); $dbhost = '127.0.0.1'; $dbname = 'test'; $dbuser = 'root'; $dbpass = ''; $dbattr = array(PDO::ATTR_EMULATE_PREPARES => false,PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC); try { $connection = new PDO("mysql:host=$dbhost; dbname=$dbname; charset=utf8mb4", $dbuser, $dbpass, $dbattr); } catch (PDOException $e) { error_log($e->getMessage()); } $query = 'SELECT count(*) as total FROM bookmarks WHERE uid = :uid'; $stmt = $connection->prepare($query); $stmt->execute(array(':uid' => $uid)); $result = $stmt->fetch(); $Total = $result['total']; if ($Total < 100) { $query = 'SELECT link FROM bookmarks WHERE uid = :uid'; $stmt = $connection->prepare($query); $stmt->execute(array(':uid' => $uid)); while ($column = $stmt->fetch()) { if ($column['bm_path'] === $bmPath) { $duplicate = true; break(2); } } $query = 'INSERT into bookmarks (uid, type, link, icon, label, date) VALUES (:uid, :type, :link, :icon, :label, NOW())'; $stmt = $connection->prepare($query); $stmt->execute(array(':uid' => $uid, et cetera...)); } I wonder if you have any suggestions about making my code better. Please remember that i can now remove the SELECT link query because you showed me how to enforce a unique link per user. Honestly, i am very happy about this info. Best wishes.
-
Hello again, I've finally added my bookmarking system and it is working! However, the unique key constraint had to be removed because it is applied to the single table. The unique constraint could only work with a table for each user. I had to add a pre-insert query to check for a duplicate entry (a loop with if column = attempted link). Other than the unique constraint error, al is good. Thanks again! edit: what i mean by unique constraint is that my site crashed with a duplicate entry error (1062) when i added the same link from a different account. I failed to realize too that the unique constraint will allow the link to be entered for only one user in the table. Best wishes.
-
advice allready given. read entire thread b4 trolling.
-
Need Help to Align the logo in Center of Footer
jodunno replied to Naveed786's topic in PHP Coding Help
use css but don't ask me why the techies name it text-align instead of content-align or something more inclusive. <style>.image { text-align: center; }</style> <div class="image"> <img src="logo.jpg" alt="John Doe"/> </div> -
so this is not correctly formed. I wish i knew how to describe the variables accurately but i do not know how to do so. let's try it this way and see if it makes sense: you need to define a way to connect to the database using pdo. thus $bdd = new PDO (); you can name this variable whatever you want to name it. $80s_rocker_still_rockin_but_missing_me_long_hair = new PDO(). get it? then you need a query, which can be called whatever you want it to be called. such as $qry, $query, $scorpions_bad_boys_running_wild. who cares about the name. The concept is important here: $jodunno_nuthin = 'SELECT * FROM convoy_part WHERE user_convoy= :I"; you are actually going to 'prepare' this query for execution. then you use another variable named anything that you want to represent the database actions being performed. $s2, $start, $kix_blow_my_fuse or whatever. $gnr_nighttrain = new PDO("bla blah", more-blah , blah); $jodunno_nuthin = 'SELECT * FROM convoy_part WHERE user_convoy= :I"; $load_the_cannons = $gnr_nighttrain->prepare($jodunno_nuthin); $load_the_cannons->execute(array(':I' => $_GET['id'])); $db_is_shooting_back = $load_the_cannons->fetch(); put it all together in one sensical operation. so let's light the cannons and fire: $query = "SELECT * FROM convoy_part WHERE user_convoy= :I'; $start = $bdd->prepare($query); $start->execute(array(':I' => $_GET['id'])); then perform your fetch. think of a dog chasin' a stick: fetch boy! $result = $start->fetch(); naming variables really doesn't matter when you are practicing code. understanding variables is 'sehr wichtig'. keep it all sensical, logical and easy to understand when you look at the code 5 years from now. The idea is to understand what $bdd represents and what $query represents, etc. you are often times getting lost and mixing variable names as if you don't understand what is happening. stay focused! Best wishes.
-
oh, yay! i am happy for you! good work! Thank you for putting forth the effort. Best wishes.
-
hello, i really have no time to code it for you. i need to mention that my last post needs to be adjusted by you. the query needs to be changed from columns to all if you wish to fill the variables correctly. so $query = 'SELECT convoy_name, convoy_organizer FROM convoys where id = :getId'; needs to be $query = 'SELECT * FROM convoys where id = :getId'; you take things to literally and i have no time to be perfect. i need to go for now.
-
we also have to deal with the missing code because php will not function correctly when it comes across an undefined variable or many undefined variables. I mentioned $convoy_kilometer not being set in an earlier post but today i see the code. I didn't see that code yesterday, so my apologies for missing this code. now that you have the data from the database, you need to integrate it into your code. You will use only this working code to retrieve the data. So your old attempts must not be included in the file anymore. replace your content with the working code then slowly rebuild the page to work with this code. a few working changes means you can speed up the process and finish the page. so if the code works, then start your new document like so: <?php session_start(); if (!isset($_SESSION['username'])) { die('<meta http-equiv="refresh" content="1; URL=">'); } ?> <!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"><meta name="robots" content="all,follow"> <link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css"><link rel="stylesheet" href="css/font.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli:300,400,700"> <link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet"> <link rel="stylesheet" href="css/custom.css"><link rel="shortcut icon" href="img/favicon.ico"> </head> <body> <?php require('connection/db1.php'); //db1.php should contain your db connection material. i've included it here to remind you that it is needed for db connection //remove this code if you have it set in db1.php. notice that we set PDO::FETCH_ASSOC so you don't need to do this in the fetch statement //start of removable code if it exists in db1.php $your_db_username = 'root'; $your_db_password = ''; $attributes = array( PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ); //end of removable code if it exists in db1.php $connection = new PDO("mysql:host=$host; dbname=$yourdbnamevar; charset=utf8mb4", $your_db_username, $your_db_password, $attributes); $query = 'SELECT convoy_name, convoy_organizer FROM convoys where id = :getId'; $start = $connection->prepare($query); $start->execute(array(':getId' => $_GET['id'])); //are you sure that $_GET['id'] is set and not empty/contains valid data? //$count = $start->rowCount(); //i think that count should still work correctly but i've commented it out to avoid problems. $result = $start->fetch(); foreach ($result as $results) { $convoy_veranstalter = $result['convoy_veranstalter']; $convoy_server = $result['convoy_server']; $convoy_date = $result['convoy_date']; $convoy_adddate = $result['convoy_adddate']; $convoy_language = $result['convoy_language']; $convoy_participants = $result['convoy_participants']; $convoy_route = $result['convoy_route']; $convoy_description = $result['convoy_description']; $convoy_kilometer = $result['convoy_kilometer']; $convoy_web_social = $result['convoy_web_social']; } ?> <?php include 'includes/inc.navbar.php';?> <!-- Sidebar Navigation end--> <div class="page-content"> <div class="page-header"> <div class="container-fluid"> <h2 class="h5 no-margin-bottom">Dashboard</h2> </div> </div> <section class="no-padding-top no-padding-bottom"> <div class="container-fluid"> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="statistic-block block"> <div class="progress-details d-flex align-items-end justify-content-between"> <div class="title"> <div class="icon"><i class="icon-user-1"></i></div><strong>Veranstalter:</strong> </div> <div class="dashtext-3"><?php if (isset($convoy_veranstalter)) { echo $convoy_veranstalter; } ?></div> </div> <div class="progress progress-template"> <div role="progressbar" style="width: 100%" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" class="progress-bar progress-bar-template dashbg-3"></div> </div> </div> </div> <div class="col-md-3 col-sm-6"> <div class="statistic-block block"> <div class="progress-details d-flex align-items-end justify-content-between"> <div class="title"> <div class="icon"><i class="icon-contract"></i></div><strong>Teilnehmer:</strong> </div> <div class="dashtext-3"><?php if (isset($count)) { echo $count; } ?></div> </div> <div class="progress progress-template"> <div role="progressbar" style="width: 100%" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" class="progress-bar progress-bar-template dashbg-3"></div> </div> </div> </div> <div class="col-md-3 col-sm-6"> <div class="statistic-block block"> <div class="progress-details d-flex align-items-end justify-content-between"> <div class="title"> <div class="icon"><i class="icon-paper-and-pencil"></i></div><strong>Kilometer</strong> </div> <div class="dashtext-3"><?php if (isset($convoy_kilometer)) { echo $convoy_kilometer; } ?></div> </div> <div class="progress progress-template"> <div role="progressbar" style="width: 100%" aria-valuenow="55" aria-valuemin="0" aria-valuemax="100" class="progress-bar progress-bar-template dashbg-3"></div> </div> </div> </div> <div class="col-md-3 col-sm-6"> <div class="statistic-block block"> <div class="progress-details d-flex align-items-end justify-content-between"> <div class="title"> <div class="icon"><i class="icon-writing-whiteboard"></i></div><strong>Server</strong> </div> <div class="dashtext-3"><?php if (isset($convoy_server)) { echo $convoy_server; } ?></div> </div> <div class="progress progress-template"> <div role="progressbar" style="width: 100%" aria-valuenow="35" aria-valuemin="0" aria-valuemax="100" class="progress-bar progress-bar-template dashbg-3"></div> </div> </div> </div> </div> </div> </section> <section class="no-padding-top"> <div class="container-fluid"> <div class="row"> <div class="col-lg-9"> <div class="block margin-bottom-sm"> <div class="title"><strong>Event Description:</strong></div> <?php echo $convoy_description;?> </div> </div> </div> <footer class="footer"> <div class="footer__block block no-margin-bottom"> <div class="container-fluid text-center"> <p class="no-margin-bottom">2020 © Your company. Design by <a href="https://bootstrapious.com/p/bootstrap-4-dark-admin">Bootstrapious</a>.</p> </div> </div> </footer> </div> </div> <!-- JavaScript files--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/popper.js/umd/popper.min.js"> </script> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> <script src="vendor/jquery.cookie/jquery.cookie.js"> </script> <script src="vendor/chart.js/Chart.min.js"></script> <script src="vendor/jquery-validation/jquery.validate.min.js"></script> <script src="js/charts-home.js"></script> <script src="js/front.js"></script> </body> </html> replace echo variables with an if isset to avoid errors if a problem exists. let us know how it goes...
-
Hello everyone, i do not know how to use json or ajax to accomplish anything in code. However, i have read many times about the benefits of json/ajax, which sound lovely to me. For example, i have a background settings page on my website where a user can turn on/off bg photos, select a bg color instead of photo, apply a tint color to a bg photo, select a tint color or apply a css bg pattern to the whole bg. I currently do all of this via form post, write to db, set in session, read from session, display selection accordingly. I am now wondering how i could do this using json or ajax so that the user remains on the page and json or ajax communicates with php to make the changes. Anyone know of a simple tutorial for this process? anyone willing to offer sample code or pseudo code? i have no idea how this works. Thank you.
-
so you are saying that it works? you see the data pulled from the database?