Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 10/18/2021 in all areas

  1. I prefer to JOIN to the subquery - it should be faster SELECT DISTINCT f.film_id, f.title FROM film f JOIN film_actor fa ON f.film_id = fa.film_id JOIN (SELECT actor_id FROM actor WHERE last_name LIKE '%depp%' UNION SELECT actor_id FROM film_actor WHERE film_id = (SELECT film_id FROM film WHERE title = 'ACE GOLDFINGER') ) actid USING (actor_id) ORDER BY f.title;
    1 point
  2. You might have more success with function toggleResponseArea() { if (document.getElementById("commentResponse").style.display == 'block') { document.getElementById("commentResponse").style.display = 'none'; } else { document.getElementById("commentResponse").style.display = 'block'; } } Or, easier still $("#reply").click( function() { $("#commentResponse").toggle() })
    1 point
  3. Margins are more complicated than simply giving you spacing from the edge some nearby element. Like they'll merge and collapse with other margins. And margins can extend outside what you think the bounding box of the element is. The comment-action's margin does not push it away from the bottom of the parent div because there was nothing to push against. That bottom edge isn't a hard edge. Think of margins as a way of spacing from other unrelated elements while padding is for spacing from other related elements; use a margin with a div + div but use padding with a div > div. Of course it's not actually that simple, but it's a start.
    1 point
  4. You're way overthinking this. Forget positioning. Let the element render where it would normally because that's where you want it. Then simply align its contents right. https://jsfiddle.net/fk9n1pbz/
    1 point
  5. So Barand did all the work and made a useful working script under the impression he was not only helping you with a personal project but helping someone who wanted to learn PHP. You then removed all public-facing attribution to Barand and broke the system, turned around and tried to sell the software he built and you broke, and now you offer him a 50-50 split but you can't understand why he's miffed about it? I mean, dude...
    1 point
  6. It displays an interactive map of his association's marina, showing all the berths and the boats in each berth. Clicking on a boat displays details of the boat and (if the user is logged in as a member) it displays contact details of the boat owner. It also allows you move boats from one berth to another, or from the waiting lists at the bottom to an empty berth. All changes update the database. Having made a change the map is redrawn. As you can see from the image below, it worked when it left the shop (login too, so it can display the owner details). I wrote this, and a few other pages, for Leon as a hobby project during the lockdown. If you examine the lower right-hand edge of the image you will see my name. When he put it on his site that name had been removed and he added footer proclaiming "Design and Development by...<his site>". If you look at the posted code (line 300 - about halfway down - my name is there but now commented out). I told him that as he wanted to claim all the credit for the design and developent then he should actually do it all. I then ceased communication. Given that history, it seems strange he should be publically crediting me now he has screwed with the code and it has all gone FUBAR. Whether he intends it as blame or just to try and embarrass me into helping out, I'm not sure. But it does give me no choice but to explain publically why I am not rushing forward to help with his problems.
    1 point
  7. Appreciate the credit Requinix. Hopefully OP will make sense of what we are telling him about 'roots'. OP - one thing that needs stressing. Your statement is something that you should NEVER do. The global array $_SERVER (along with many others) is not for changing. It is for reading only in order to gather info that you are seeking, not to save info that you want to use. On my host my domain was setup by my provider to give me a 'root' of "/home/albany/public_html". If I had wanted to setup all my 'stuff' in a myproject folder then I would append that to my provided root path to give me "/home/albany/public_html/myproject".
    1 point
  8. I would say ginerjm had the answer and I just stepped in to help address a bit of confusion about it.
    1 point
  9. So unfortunately there's three different "roots". Which one someone means depends on context. 1. When it comes to files and directories in Linux, / is the root. Not "home" - that's where your personal files are, and is typically /home/something. 2. When it comes to figuring out where stuff is when you're dealing with PHP code, the "root" means the place where your web server starts holding files. That would be /opt/lampp/htdocs. 3a*. When it comes to URLs and other things you see when you're browsing a website, the root is also / according to what's in your browser's address bar. Not including the http(s) or domain name but the first slash right after. The second and third are closely related: the root of where your web server is hosting files is /opt/lampp/htdocs and that is the same as / in the address bar. Unless you tell your server differently, if you go to http://localhost/MyProject/uploads/whatever.ext then the web server is going to look for the web root (/opt/lampp/htdocs) + the path portion of the URL (/MyProject/uploads/whatever.ext) and try to find a file named /opt/lampp/htdocs/MyProject/uploads/whatever.ext. What ginerjm is talking about is the second one, and whose value you can get in PHP with $_SERVER["DOCUMENT_ROOT"]. You do not set that value yourself. PHP gives it to you for free. If you want to take a file upload and always place it in the root of your web site + /MyProject/uploads/ then you need the DOCUMENT_ROOT plus that path part (and probably plus a file name itself). $fileDestination = $_SERVER["DOCUMENT_ROOT"] . "/MyProject/uploads/" . $fileNameNew; Now here you've got a slight problem: that /MyProject piece. That's not going to be there in the real site, but you have it in your setup. You have two basic choices for how to deal with that: 1. Tell your web server to host files out of MyProject. That requires going into the server configuration and changing some values. There's a right way and a wrong way of doing this, so rather than deal with that, just ignore this option. 2. Put all your MyProject files into the htdocs directory. This is really easy. The downside is that you can't have multiple websites anymore because http://localhost is always going to be what's in /opt/lampp/htdocs and that's always going to be the "MyProject" stuff. Once you've moved the files you can get rid of the "MyProject" stuff in your code and your local site will be one step closer to working like the real site will. $fileDestination = $_SERVER["DOCUMENT_ROOT"] . "/uploads/" . $fileNameNew; * There's a 3b option where you might say "well no, I consider the root of my site to be http://localhost/MyProject". Saying things like that is an easy way to get everybody confused so stick with 1, 2, and 3a.
    1 point
  10. Root to the rest of us is a specific term that is related to the domain or the html web root. So I am assuming that your root myprojects folder is under the true html root folder. So if you want your php commands to locate the folder you want you need to probably specify $_SERVER['DOCUMENT_ROOT'] as I mentioned along with the /MyProjects/../...... path to your desired folders. $_SERVER['DOCUMENT_ROOT'] . '/MyProjects' would position in what you are calling root. If you other folders are beneath that then add them to it with a leading backslash of course. Hope this is what you are looking for.
    1 point
  11. Using Bootstrap 4 cards, something like: <?php require "database/dbconfig.php"; //include_once __DIR__.'/core-php-admin/database/dbconfig.php'; $query = "SELECT * FROM users"; $query_run = mysqli_query($connection, $query); if (mysqli_num_rows($query_run) >0){ ?> <div class="container py-5"> <div class="row"> <?php foreach ($query_run as $row){ ?> <div class="col-4"> <div class="card"> <img class="card-img-top img-fluid" src="//placehold.it/500x200" alt="Card image cap"> <div class="card-block"> <h4 class="card-title">Card title</h4> <p class="card-text">Card body</p> </div><!-- /card-block --> <div class="card-footer"> Card footer </div><!-- /card-footer --> </div><!-- /card --> </div><!-- /col-4 --> <?php } ?> </div><!-- /row --> </div><!-- /container --> <?php } else { echo "No record found"; } ?>
    1 point
  12. Step away from the computer for a while, eat something, then come back and look at if ($lang = "en")
    0 points
This leaderboard is set to New York/GMT-04:00
×
×
  • 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.