/    Sign up×
Community /Pin to ProfileBookmark

so i have a nice big sql query that inserts the value of every field into the database.

the problem is that if the user leaves the field empty, i get the following error:
Line 1: Incorrect syntax near ‘,’.

this is because with the empty value, there is now an extra ‘ ‘ in the query. is there another method i can use so that i can send only the data that was entered into the database? my current method obviously has flaws.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@SheldonSep 25.2007 — Post what you have so far. in [ php ] [ /php ] tags
×

Success!

Help @ixxalnxxi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...