IN..."> IN...">
 
Previous Thread
Next Thread
Print Thread
Rate Thread
#279830 09/22/2004 10:22 PM
Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
I added two fields to my post table and can't figure out why addpost.php will not update the database.

isn't this correct?
Code
<br />$query = "<br />	INSERT INTO {$config['tbprefix']}Posts (B_Board,B_Parent,B_Main,B_Posted,B_Last_Post,B_IP,B_Subject,B_Body,B_Kept,B_Status,B_Approved,B_Icon,B_Reged,B_Poll,B_Replies,B_Topic,B_Convert,B_PosterId,B_AnonName,B_Sticky,B_ParentUser,B_CalDay,B_CalMonth,B_CalYear,B_AddSig,B_FMVersion,B_FMPlatform)<br />	VALUES ('$Board_q','$Parent','$Main','$date','$date','$IP_q','$Subject_q','$BodySig','$Kept_q','$PStatus_q','$Approved_q','$Icon_q','$Reged_q','$PollId','0',$MainTopic,'$convert_q','$posterid','$AnonName_q','$Sticky','$ParentUser','$calday','$calmonth','$calyear','$addsig','$fmversion','$fmplatform')<br />";<br />


if you want to see the template or script let me know I'll post em.

Sponsored Links
sdf123 #279831 09/22/2004 10:24 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
The query is correct - maybe the variable isn't getting set right.

To test - before that query put this:

echo "fmversion: $fmversion fmplatform: $fmplatform";
exit;


Now make a post - the screeen will display the above. Make sure they each have a value, if not, track it back and check all the variables. Might be a typo somewhere.

Daine #279832 09/22/2004 10:57 PM
Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
this was the result...

fmversion: fmplatform:


I have this near the top of the script...

$fmversion = get_input("fmversion","post");
$fmplatform = get_input("fmplatform","post");

Last edited by oceanwest; 09/22/2004 10:59 PM.
sdf123 #279833 09/22/2004 11:01 PM
Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
This is the code in the template (newpost.tmpl)

Code
<br />{$ubbt_lang['FM_VER']}<br /><br /><br /><select name="fmversion" class="formboxes"><br /><option value="{$user['U_FMVersion']}">{$user['U_FMVersion']}</option><br /><option value="">----</option><br /><option value="">n/a</option><br /><option value="">----</option><br /><option value="3">3</option><br /><option value="4">4</option><br /><option value="5">5</option><br /><option value="6">6</option><br /><option value="7">7</option><br /><option value="">----</option><br /><option value="Dev 6">Dev 6</option><br /><option value="Dev 7">Dev 7</option><br /><option value="">----</option><br /><option value="Server 3">Server 3</option><br /><option value="Server 5">Server 5</option><br /><option value="Server 7">Server 7</option><br /></select><br /><br /><br /><br />{$ubbt_lang['FM_OS']}<br /><br /><br /><select name="fmplatform" class="formboxes"><br /><option value="{$user['U_FMPlatform']}">{$user['U_FMPlatform']}</option><br /><option value="">n/a</option><br /><option value="Windows XP">Windows XP</option><br /><option value="Windows 2000">Windows 2000</option><br /><option value="Windows 95/98">Windows 95/98</option><br /><option value="Mac OS 9">Mac OS 9</option><br /><option value="Mac OS X Panther">Mac OS X Panther</option><br /><option value="Mac OS X Jaguar">Mac OS X Jaguar</option><br /><option value="Linux">Linux</option><br /></select><br /><br /><br />{$ubbt_lang['POST_TEXT']}

sdf123 #279834 09/23/2004 12:53 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Are you previewing?

If so you'll need to add them as hidden fields in the addpost_preview template - otherwise there's nothing passing them from addpost.php back to addpost.php when the post is made.

I bet the way it is now would work without preview.

Sponsored Links
Daine #279835 09/23/2004 2:09 AM
Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
Thanks That did the trick.

sdf123 #279836 09/23/2004 12:36 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Power of the fanny pack.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)