Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
You added it *where*? Post your new code.
-
Well there's no get param. It's not set to '', it just doesn't exist. You need to add a check to see if it is or is not set and default it to "home".
-
Uhm, yes. $query is what you called your result set. What we were telling you to change.
-
What's the URL you're visiting?
-
That's not the right object. It expects a result set. What in your code creates a result object?
-
Echo the query
-
Remove all the @ and read the line the message tells you is wrong.
-
*smh* I just told you what the problem was.
-
You're not FIXING the error, you're HIDING it. You ARE getting errors, you just IGNORED them. That error is VERY VERY useful. It's telling you it expects a specific object. You're giving it a string. Look at your code - what argument are you giving mysqli_num_rows? It's not "as hard as possible", it's actually very clear English. Slow down and think about what each line does.
-
You need to remove all the @ What do you get when you run the query in mysql?
-
You're suppressing errors and not catching others. Read the debugging SQL link in my signature.
-
Print_r($page); ??
-
Try checking for SQL errors, see my signature.
-
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
Hardcoding lookup ids and repeating the same code on every PHP page - probably about the worst possible way to create a dynamic site. You're still going to have to update your pages every time you make a new one. All you have done is create MORE work for yourself with absolutely no benefit. Don't get pissy with me because you can't wander a simple question. I'm not being sarcastic at all in any of my posts. The solution you've come up with is time wasting and offers no benefit. If you could bother to stop and think, and answer a simple question I asked you or try the solution I was suggesting, you might actually code something useful. -
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
With your keyboard. -
Add a variable outside of the function, such as "clicked", and declare it false. The first line of the function should check if it's false. if it is, set it to true and do everything else.
-
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
If you're viewing page #2, your url should look like page.php?id=2 Then in your code you can do $id = (int) $_GET['id']; Easy. -
You need to turn on error reporting, and you'd see a big problem. Edit: Uh oh, what have I done? :-P
-
Newbie who can't get his form to echo correctly
Jessica replied to vincewentwrong's topic in PHP Coding Help
You're not actually learning anything by copying and pasting and not knowing what it does. Look up the syntax in the manual, and read the manual. Look for Strings first. -
stopping bots with php,are you human a easy idea.
Jessica replied to redarrow's topic in PHP Coding Help
The best way I've found is to have a hidden input with an obvious name like "comments" or "message". If it IS filled in, that's a bot. -
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
There you go - you have an id. You would typically use the URL query string to specify the id, then use $_GET to get it. -
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
If you don't know how can we help you? Again. It's not a trick question, it should have a simple answer. Something like an id or a page name. If you have two sets of data how do YOU KNOW when you look at them which set goes with which page? If you really don't know then the data is meaningless!!! -
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
It's like if you had an address book with a bunch of addresses and phone numbers and no way to tell who they belong to... -
Load Meta data dynamically from mysql database
Jessica replied to Skorpio's topic in PHP Coding Help
So you just have a list of meta data with NO CLUE what page each item goes with? What's the point then?