Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
You need to read up on data sanitizing. In addition to just plain not working, your script is open to SQL injection. If you were checking for MySQL errors as well you'd get a useful error explaining why it doesn't work.
-
How to print PHP errors and warnings in the web browser?
Jessica replied to dariyoosh's topic in PHP Coding Help
For future reference you can view your actual settings by doing php_info() or an ini_get() so you can check if you changed anything -
And we should "trust" you why???
-
Because something is adding LIMIT 0, 10 without the space after DESC. Did you actually read the error??
-
<td>Forum ID<td/> Notice anything??
-
If you make your function return a value instead of echoing it, you can call it before you need to echo the value. Your logic should be separate from your presentation.
-
You still never run the query. Now it's a string, which is better. But it's just a string.
-
http://www.php.net/manual/en/function.end.php See how end expects a variable passed by reference? I personally haven't encountered this but I wonder if doing it this way will resolve the error: $arr = explode("/", $_SERVER['SCRIPT_NAME']); $page_name = substr(end($arr), 0, -4); Edit: Actually I'm 99% sure that would fix it. "The array. This array is passed by reference because it is modified by the function. This means you must pass it a real variable and not a function returning an array because only actual variables may be passed by reference." From the manual.
-
Why not do one big rectangle of one color, then you only have to do the other color's squares?
-
First attempt at designing an MVC for my new project
Jessica replied to MySQL_Narb's topic in Application Design
I moved it here from PHP coding help, that's my bad Kevin. Application design is a better place. -
And that's why using your actual code and not an example matters.
-
The very last line that isn't a comment is an SQL statement, but it's not in a string. It's just sitting there in your code. The blank page indicates you need to turn on error reporting.
-
The code you attached is dramatically different from the code you posted, and doesn't have anything like this code. Your code also stores First and Last name in separate fields (which is GOOD) but you're only echoing 'name' in your posted code. Edit: The fact that you're running mysql_real_escape_string on values you just SELECTED from the database makes me think your code has some serious issues. You're not checking for any SQL errors either. Edit 2: You ALSO are trying to use $ID before it's been defined for your update. Turn error reporting on!
-
Did you check that the information in your database is what you think it is? What do you get when you run the query in MySQL or phpMyAdmin? What if you do a print_r() on $res?
-
You don't typically set a page color for a document like that. 1. Printers can't print to the edge of the page, so you'd have a white border. 2. Think of how much ink that would use. I doubt it's possible to set the page color. You could just draw a big rectangle over the whole page.
-
Because your echo is outside of your while loop.
-
You'll want to use usort
-
How to have a single column holding multiple INT id's
Jessica replied to ChrisC123's topic in PHP Coding Help
Good job. -
Parse error: syntax error, unexpected 'or' (T_LOGICAL_OR)
Jessica replied to bleured27's topic in PHP Coding Help
Then don't call yourself a pro. Being 16 is not an excuse to be a whiny baby. You're well old enough to: A. Use correct grammar and spelling in your posts B. Take responsibility for your own education. Especially if you've been programming various languages for 4 years. When you learn something new, don't whine about how you didn't know it before. C. Read the rules and guidelines of this forum and follow them. -
Parse error: syntax error, unexpected 'or' (T_LOGICAL_OR)
Jessica replied to bleured27's topic in PHP Coding Help
That code could not produce that error. If you look at the error it will tell you the file and the line number. -
We can read the code, that doesn't tell us what YOU WANT TO DO and most importantly WHY. As an aside, if PHP *HASN'T* changed dramatically in 15 years it would be dying. Have you bothered to do any reading about PHP??? 1. Why do you have so many userX columns? normalize that data. 2. You don't need to select a row just to update another row. 3. you have random SQL in your PHP code, not in a string, not being executed. 4. you haven't even told us what is going wrong. We are not psychic. Only you know what you want to happen, and what you don't like about what does happen.
-
Parse error: syntax error, unexpected 'or' (T_LOGICAL_OR)
Jessica replied to bleured27's topic in PHP Coding Help
I think OP isn't posting his entire code, just random bits of it, because he doesn't even know what it all does. -
Parse error: syntax error, unexpected 'or' (T_LOGICAL_OR)
Jessica replied to bleured27's topic in PHP Coding Help
By the way someone who can't resolve a simple syntax error is not a pro in php. I'm also not confident you know the difference between Java and Javascript. -
Parse error: syntax error, unexpected 'or' (T_LOGICAL_OR)
Jessica replied to bleured27's topic in PHP Coding Help
Stop putting the ; before the or. -
And no, we can't tell what you're trying to do. I can tell you if you have a table that has 10 fields called user1-user10, it's WAY wrong. Why don't you explain exactly what the steps are you are trying to complete?