View Full Version : A link that will run a mysql query?
piazafan31
July 10th, 2003, 21:51
Im tryying to make a mod for invision(i know they have a support place but nobody has replied to my topic that i made a few days ago yet:( but im trying to make a box that will query the database and change a variable there so like theres a dropdown box that asks how much to take away or something.
thanks:D
ECTrimble20
July 11th, 2003, 22:50
assuming you have access to the database the forum is on its fairly simple. Just for an example lets say you want to modify someones post count. First locate the user part of the forums DB, then gather the information on which user you want to change the post count for. Once you've done that create HTML code like this...
/*use a query to find out how many post the person has and call that variable userpost and a variable telling which person to edit and call it user */
<form method=post action=yourmainscript.php>
<select size=10 name=postc_edit>
<option>$userpost</option>
<option>yourvalue</option>
<option>yourvalue</option>
<option>yourvalue</option>
<option>yourvalue</option>
</select>
<input type=submit value=Edit>
</form>
now you'll need to run an edit(update in mysql) query like this...
$update_q = "UPDATE yourdbconnect SET users_post='$postc_edit' WHERE $user_name='$user' LIMIT='1'";
now run the query like so...
mysql_query($update_q, $my_invision_database);
that will use the info you've entered to update the database... you can modify it to do almost anything. Hope that helped
piazafan31
July 12th, 2003, 00:14
thanks ill try it
thanks:D
ECTrimble20
July 12th, 2003, 01:04
if u have any problems feel free to ask, and good luck!
;)
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.