ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
The proper order of keywords in a MySQL SELECT statement, per the manual, is: SELECT FROM [JOIN] [WHERE] [GROUP BY] [ORDER BY] [LIMIT]
-
You must disable javascript and then refresh the page.
-
Don't bump, it's against the rules. We're not paid to come here. 4) Exactly what I said. You cannot quote column names. This WHERE clause will always return zero rows, because the string 'desc' will never equal the site's description unless you happened to type 'desc' 6) This is a design thing and I don't know how you want your site to work, so ignore it.
-
Random id for dosie witch does not exist in database
ManiacDan replied to neven's topic in PHP Coding Help
Use auto-increment columns to automatically assign an ID to an item when you insert it. Also, you might be better off posting in a forum for your native language. -
They include 6 different jquery modules on the landing page. I'm pretty sure that's all jquery.
-
Create the table first, then alter the table to add the foreign keys one at a time until you find the problem.
-
Extremely doubtful that it's due to a minor sub-version difference. You have a function that returns a list. On one machine, the last item in that list is empty. Go into that function and figure out why. Or simply wrap this whole thing in an if ( !empty() ) check. -Dan
-
Things I see wrong with your code: 1) you set $url and $desc and never use them. 2) You use $_POST['url'] and $_POST['desc'] before you check to see if they exist. 3) You re-set $url and $aprasymas as htmlspecialchars(), but that's wrong for use in a query. Also, you still don't use them 4) Your SELECT is malformed, 'desc' cannot be quoted like that. 5) You're not running the insert query inside your IF 6) This script will echo "Yes!" for each entry of unique description for each URL. If I use google.com with 8 different descriptions, there will be 8 entries in the DB. I don't know if you want that.
-
Don't use a text file, use a database. ORDER BY RAND(), once your data is in a database, will order this by rand. Local business directories almost always fail. There is no reason to use your product over Google Maps as you've currently described it. Plus, how would you get the information to display? You already said you know how to make a website that looks like your example. If you're using it from a database (which you absolutely should be), then adding ORDER BY RAN() to the end of your query will change your existing in-order website to a random-order website.
-
The word "variable" doesn't exist in your code. The only thing that can possibly help us (and you) is the actual error message. Not a summary, not a paraphrase, the error itself.
-
That was the exact same expression silkfire gave in your other thread, except silkfire forgot the square brackets.
-
Note that your HTML tag had a random / in the middle for no reason. I fixed it in my code (moved it to the end) but mj did not. Be careful with the syntax. -Dan
-
mysqli_fetch_array($result, MYSQLI_ASSOC) while loop problem
ManiacDan replied to kasitzboym's topic in PHP Coding Help
Yeah this is a pretty silly way of doing it, but requinix is right. You need: loop where both fetches are && together. if row is false, loop through result2 and display the right-column if row2 is false, loop through result and display the left-column Still though...this is weird and difficult. -Dan -
Ok, so then...one of your images is empty for some reason. Why could that be? Clearly these are different databases. Go look at the records.
-
mysqli_fetch_array($result, MYSQLI_ASSOC) while loop problem
ManiacDan replied to kasitzboym's topic in PHP Coding Help
Your loop construct does first one, then the other, because you're using the logical OR. If you want to do side-by-side tables, the easiest way is to have two sets of side-by-side DIVs with fixed heights floating next to each other. -
You cannot "nest" PHP tags. You can only open PHP tags if the previous one has been closed. You want to research string concatenation. This is correct: <?php echo htmlentities('<img src="' . bloginfo('template_directory') . '/images/my-image.png" rel="nofollow" />'); ?> -Dan
-
If you echo "here" every time you don't know where you are. I always: echo __FILE__ . " at line " . __LINE__ . "<br />\n"; -Dan
-
Given that you had another thread where you asked this exact same question and then said you wanted something different, how about you explain what you mean?
-
More importantly, it saved you a round-trip to the database. 500 lines of PHP can execute in the time it takes to make a round-trip to the database to execute a query.
-
SELECT checklist.* from checklist JOIN files ON checklist.id = files.id WHERE files.category = 'W'
-
Clearly $imgurl is empty. Which means that $result is also empty. Which means that either $photos is empty, or wp_get_attachment_url is not working. Figure out which it is. This is how you debug things on your own.
-
/^[a-z ,]+$/i
-
You should actually be doing this with one JOIN to join these two tables.
-
You need to use loops to get all the rows. Right now you're just fetching the first result of the first query, and using it as the only ID in your second query. The manual has proper syntax.