Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the system less complex and reduced the code size #5

Merged
merged 1 commit into from
Sep 25, 2014
Merged

Made the system less complex and reduced the code size #5

merged 1 commit into from
Sep 25, 2014

Conversation

xeoncross
Copy link
Contributor

Made a db() and query() function to make future expansion easier. Reduced the amount of code it took to write the system.

if (isset($_POST['yo']) && $_POST['yo']) { sendmessage($db,$_POST['yo']); }
$res = getmessages($db, 25);
$msgs = $res->fetchAll();
if ( ! empty($_POST['yo'])) { sendmessage($_POST['yo']); }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does using empty() prevent both a PHP notice if the value isn't set AND prevent against calling sendmessage on "" values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, empty does that.

danieltalsky added a commit that referenced this pull request Sep 25, 2014
Made the system less complex and reduced the code size
@danieltalsky danieltalsky merged commit e7898f1 into danieltalsky:master Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants