• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

MySQL/PHP help

Winchester

Diamond Member
I am trying to use one drop down box to input different data into two fields. So when someone selects Publisher from the box it will write 21 to my 'gid' field and publisher to my 'usertype' field.

ex.
usertype = publisher
gid = 21



The add code is not working so see this text for my code description.
Click for code


 
It works perfect on the other page, but that was done by a previous coder. I am creating a new page but want the same effect.

How does $gid_post = $_REQUEST["gid_post"]; compare to GetSQLValueString($_POST['gid'], "text"),
 
Is it possible to create a trigger so that if gid = 21 that it makes usertype = publisher as a bypass? So if I create a user the server would automatically do the trigger for me?

Would have to also do 19 = author, 23 = manager.


something like?
select gid FROM mos_user
if gid = 23 then INSERT usertype Manager
if gid = 21 then INSERT usertype Author
if gid = 19 then INSERT usertype Publisher
 
I assume on the html, you have <form action="process.php" method="post"></form> around your option right?

Try changed this: $gid_post = $_REQUEST["gid_post"];
To :$gid_post = $_POST["gid_post"];


You could commented out the sql insert code, and echo the $gid_post to see if you get the correct number return, if it is correct, it means the sql insertion code is not correct.
 
Back
Top