Jump to content

[SOLVED] PHP Code for an Empty mySQL Query


Hartley

Recommended Posts

Hey, I'm working on coding a system that will create a user row in a table, but first, I need the system to check initially to make sure if there is the need to do it (IE: if no row exists for said user). Right now I have it set up to pull out the following:

 

$permissions = "SELECT forumid, memberid, setupstatus FROM user WHERE forumid = " .$_COOKIE['bbuserid'];
$permquery = mysql_query($permissions);

 

I want it to check the table to see if there is a row for someone with a specific forumid (I use vBulletin, but it only relates in this case for the cookie). IF it shows up that there is a row, I want it to set $memberstat = 2; so that I can use that variable for various other page functions. If it shows up empty, it will set it equal to 1. How can I achieve this? Thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.