![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
dannyb785
-
Posts
544 -
Joined
-
Last visited
Posts posted by dannyb785
-
-
Ok, so maybe not hack... but tell me what vulnerabilities there are. This is a client's website and it is entirely database driven so I would say it's successful if a visitor wouldn't have any way of modifying anything from the database.
-
Even if it does work, users are accustomed to seeing radio buttons and only checking one. If it works, it just means you added them completely wrong.
Plus, try unchecking them as radio buttons
-
ok, i have looked at the enum docs. so ENUM(0,1) will have the 0 false and 1 true values in it.
How do i set that in phpmyAdmin?
no.
enum allows you to setup the column so only specified value can go into it. If you want 0 and 1 to be the only values allowed, then you'd do ( '0', '1' ). It has nothing to do with 0 false values and 1 true. You need to think about why you are making the column enumerated. Is it required that the column only be one of a few different choices? If not, just make it a varchar or an int
-
on your submit button, you have onclick=wstxSubmitForm(this) but I dopnt see the wstxSubmitForm() anywhere on the page nor did I find any included .js files that had it in them.
Also, for current medications, you have "check all that apply" but you have radio buttons... so a user can only check one at any given time... you need to change them to checkboxes.
-
I believe the enum values need to be in single quotes. So: 1 becomes '1' and if there are more than one, separate by a comma.
And for INT, you dont need to specify a length
-
When I said x=y, it meant any possible conditional that would specify which rows get updated. Like "WHERE user_id = 5" or "WHERE user_fname='Bob' " or whatever. But if you leave out the WHERE part, it will update every single row with the stuff after SET
-
I am pretty sure that I have inserted the data into the database, and the search brings up this error.
SQL query:
WHERE fname LIKE '%mike%'
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE fname LIKE '%mike%'' at line 1
fname is the column name, and mike has been inserted in there, I am pretty sure.
lol dude, when I said "WHERE fname LIKE '%mike%' " I meant to add that to the end of the "SELECT * FROM table" statement.
-
"UPDATE User SET user_level=3"
that will update every single row's user_level to 3. if you want to hone the update a little more, end the query with "WHERE x=y"
-
Thank you for your demeaning help.
Thank you for not following the rules. I guarantee you could google it and find a million answers
-
will you post the query you're using and the results you're getting?
-
for the previous image, SELECT * FROM Image WHERE image_id < '$current_image_id' LIMIT 1
for the the next image, SELECT * FROM Image WHERE image_id > '$current_image_id' LIMIT 1
that won't work..
okay current image is 5 i have 10 images (from 1 to 10)
using the above selects next would be 6 BUT prevous would be 1.
as i suggested before do some reseach on pagination, here some info
http://www.tonymarston.net/php-mysql/pagination.html
you could also search this forum.. when it comes to $rows_per_page just use 1
My bad, for the 'previous' link, you'd need to order by image_id DESC. Then it'd be fine.
MadTechie - I'm reading up on pagination as we speak ;-)Really appreciate your help.
Loving this PHP stuff!
good to know you didn't even acknowledge my help.
-
Ok, I'm using the column names that you provided, here's what you should do
SELECT *, (rating / (todays_date - dateJoined) ) AS sort_info FROM 'table' ORDER BY sort_info DESC
or make DESC into ASC if that corrects the order
By doing the math with the columns and putting AS, you create a new column that is based on the function provided. And then you'd just sort by that new column.
-
Is it a problem going backwards and forwards from the database like that?
it's not bad, just probably uses more processing memory than needed. bc if one image is id #2 and the next is id#30, you have to check 28 images before you find one. Even though computers are pretty fast, kimagine if you have a few hundred(or thousand) users doing it at the same time. Not efficient!
An easy method you could do would be
for the previous image, SELECT * FROM Image WHERE image_id < '$current_image_id' LIMIT 1
for the the next image, SELECT * FROM Image WHERE image_id > '$current_image_id' LIMIT 1
where $current_image_id is the image currently being viewed(if that wasn't obvious).
-
Must not have searched hard enough. I found this in about 10 seconds. under the html section:
http://www.phpfreaks.com/forums/index.php/topic,205805.0.html
-
What value are you trying to sort? Joindate? Or the value that is the difference between joindate and now? Whether it's either, just do ORDER BY joindate and then DESC if you want the most recent joined or ASC of you want the ones whove been the longest.
-
can you give an example of what you mean?
-
php code can only be processed in a file with the .php extension
-
lol there are so many of these threads. Nobody ever reads the rules that say search before posting
-
ok now it loaded
-
are you using shared hosting?
-
didn't load for me
-
I don't use apache. And i've never had problems adding a new domain to my server.(then again, i use shared hosting, so that may be different)
-
did you type that query yourself or did you use phpmyadmin?
edit: remember, you need to just ADD a column quote_id, not modify a current column. And you have to make it a data type of int, not varcharr
-
KEY is a MYSQL Reserved Word, you can't use it as a fieldname unless you backtick it.
duuuuuude that's it.
editL that's a perfect example of why, when I create a table, I name my rows according to the table's name. i.e. if my table name is downloads, I start ALL my column names with "dl_" or "d_" or something simialr. That way I never run a risk of naming a column after a keyword. Plus it's easier for me to identify which variables go to which values. I suggest you do the same.
[SOLVED] Myspace type solution
in PHP Coding Help
Posted
Ready for the complicated, in depth, difficult code to accomplish this task? It goes like this:
you will have a file in your main directory called '.htaccess'(just that, no more no less). Open it in an editor, and add the following lines:
Granted, viewprofile.php and the $_GET['user'] variable needs to be replaced with whatever page you have that views the user's profile