Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
How can it use them in the average if they don't have a value? $a = 1; $b = 2; What's the average of $a, $b and $c?
-
Use $(this)
-
storing and displaying image from database via filepath
Jessica replied to Drumlegend's topic in PHP Coding Help
You don't know whether to put the URL there or... What?? Do you know how to display an image in HTML?- 29 replies
-
php if(mysql_num_rows(mysql_query("$SELECT")
Jessica replied to RonnieCosta50's topic in PHP Coding Help
That query won't return two rows. You're still using the wrong function. Use mysql_fetch_assoc -
Just remove that line and the one above it. And the one later trying to set magic quotes again.
-
php if(mysql_num_rows(mysql_query("$SELECT")
Jessica replied to RonnieCosta50's topic in PHP Coding Help
A query with a COUNT will always return exactly one row (assuming no grouping or other aggregates). The count of rows matching the criteria. Run the query in mysql and you'll see. You need to give the count an alias so you can use it in your script. -
storing and displaying image from database via filepath
Jessica replied to Drumlegend's topic in PHP Coding Help
The one where the image is... I don't understand your question at all. Is the folder in the web root? Then the path is that folder and the image filename.- 29 replies
-
We also have a sticky thread with how to handle these errors.
-
im going to fail if i cant do this please help
Jessica replied to PhpSyntaxerror's topic in PHP Coding Help
Pretty sure your teacher is fine. You just have a listening problem. -
im going to fail if i cant do this please help
Jessica replied to PhpSyntaxerror's topic in PHP Coding Help
Again - what part are you "stuck" on? Do you understand exactly what you're trying to do? Once you know what your goal is, find the functions that will do it, then write the code. Stop trying to use other people's code, and write your own. -
im going to fail if i cant do this please help
Jessica replied to PhpSyntaxerror's topic in PHP Coding Help
It's amazing how many people come on here and complain about their teachers being horrible. Your response to a bad teacher is to basically give up? Don't schools these days have administration anymore? When I had a bad teacher I complained to the people who could actually do something about it. Anyway since you've still not posted what errors you got with what code, you're still basically asking someone to do it for you. In the future, use code tags when you post, your code is unreadable. -
im going to fail if i cant do this please help
Jessica replied to PhpSyntaxerror's topic in PHP Coding Help
Why don't you try writing your own? You're not going to school to learn how to copy and paste are you? -
im going to fail if i cant do this please help
Jessica replied to PhpSyntaxerror's topic in PHP Coding Help
You need to show us what you tried and what didn't work. Our rules specifically state that we are not here to do your homework. If you can't do the coursework, you deserve to fail. If you can make an effort and get help based on the work you've done, that's fine IMO. -
Go read the documentation on the function you're using and then read about arrays. Then if you're still stuck post the actual code and errors.
-
If you keep only showing bits and pieces and refusing to post actual errors with line numbers, this will take forever. Because I will go away.
-
Live Database search using PHP, MySQL, and JSON
Jessica replied to phpnewbie34's topic in Javascript Help
Yes.Google "Ajax" -
What error? Did you try any debugging?
-
Post what you tried. Your code didn't have any fetch before.
-
You should store in the session the user's ID, and a unique value to each user, which is also stored in the database (not their password). Use this to select the user's info when you need to use it. There's no need to use base64 encoding, or serializing (you're serializing a string, btw. Useless upon useless.) Make sure to add a die() after your header, and don't ever suppress errors.
-
I'm not really interested in reading your code. The point is you know what user is logged in. You then need to determine if the user who is logged in is in the right group to view the page. What are you stuck on?
-
So how does your site know if a visitor is logged in or not?
-
strpos/stristr/strstr not returning true when they should be
Jessica replied to kernelgpf's topic in PHP Coding Help
You have your parentheses messed up. (strpos($string, "/images/grey_pins" !== FALSE))Is passing strpos two arguments, first is: $string, second is: "/images/grey_pins" !== FALSE Fix your parens and it should work. -
So it sounds like you don't have any kind of authentication in place already. Do your users register and login?
-
$sql = "select * from mr_recipes WHERE id "; $rs = mysql_query($sql, $conn) or die ('Database not found ' . mysql_error() ); $result = mysql_query("SELECT * FROM mr_recipes"); while($row = mysql_fetch_array($result)){ Exactly as you've told it to. Your first query (the one you should use) is missing the rest of the where clause btw.
-
Read the manual page for mysql_query. It has sample code to follow.