Previous Thread
Next Thread
Print Thread
Rate Thread
Updating 2 fields? #279830 09/22/2004 9:22 PM
Joined: Apr 2002
Posts: 474
oceanwest Offline OP
Enthusiast
OP Offline
Enthusiast
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
Re: Updating 2 fields? [Re: sdf123] #279831 09/22/2004 9:24 PM
Joined: Nov 2001
Posts: 10,369
JoshPet Offline
I type Like navaho
Offline
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.

Re: Updating 2 fields? [Re: Daine] #279832 09/22/2004 9:57 PM
Joined: Apr 2002
Posts: 474
oceanwest Offline OP
Enthusiast
OP Offline
Enthusiast
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 9:59 PM.
Re: Updating 2 fields? [Re: sdf123] #279833 09/22/2004 10:01 PM
Joined: Apr 2002
Posts: 474
oceanwest Offline OP
Enthusiast
OP Offline
Enthusiast
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']}

Re: Updating 2 fields? [Re: sdf123] #279834 09/22/2004 11:53 PM
Joined: Nov 2001
Posts: 10,369
JoshPet Offline
I type Like navaho
Offline
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
Re: Updating 2 fields? [Re: Daine] #279835 09/23/2004 1:09 AM
Joined: Apr 2002
Posts: 474
oceanwest Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Apr 2002
Posts: 474
Thanks That did the trick.

Re: Updating 2 fields? [Re: sdf123] #279836 09/23/2004 11:36 AM
Joined: Nov 2001
Posts: 10,369
JoshPet Offline
I type Like navaho
Offline
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Power of the fanny pack.


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
Pilgrim
Pilgrim
NH, USA
Posts: 190
Joined: June 2000
Forum Statistics
Forums63
Topics37,524
Posts293,716
Members13,832
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 84
Topics Created 0
Posts Made 1
Users Online 1
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,790
Greg Hard 4,625
Top Posters(30 Days)
isaac 13
Gizmo 3
Top Likes Received
isaac 27
Brett 7
Morgan 2
Slaz 1
Top Likes Received (30 Days)
isaac 27
Brett 7
Morgan 2
Slaz 1
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2019 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20191214.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.038s Queries: 29 (0.012s) Memory: 3.2775 MB (Peak: 3.4445 MB) Data Comp: Zlib Server Time: 2019-12-15 10:11:07 UTC
Valid HTML 5 and Valid CSS