Jump to content

notacoder

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

notacoder's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I appreciate the reply JCBones and I am going to give that query a shot in a few seconds. And the reason I can't set the default signup balance to $25 is that I can't view or edit the source code unfortunately. So, I can't quite see or edit where the account gets "setup" and have to edit the db manually. I'll get back to you shortly with results of that edit.
  2. I've also received several others with other small modifications to the query. Of course, I've received mysql query syntax errors. I've received Resource id #3. Which I think mean's there was no matching queries. However, I'm looking at the entries inside of the database and the date matches today's date and everything else is right so it's a problem with the mysql wildcard query not being the right one and not matching the appropriate criteria.
  3. Here's the current one I'm getting... Catchable fatal error: Object of class stdClass could not be converted to string in /home/****/public_html/datetest.php on line 22
  4. Hello, I defnitely don't consider myself a coder but have been installing and troubleshooting pre-made php scripts for a few years now and figure now is a good time to learn as I'm quite sick of having to rely on outsourced help I am currently trying to create a simple (hope so) script that will run on a cron every other minute to insert a specific piece of data each time a new member joins and it should only insert the data once based on criteria. Here's what I'm trying to do exactly with a php script check members table if field signup_date is TODAY's Date and if user_balance field is 0.00 then alter/update user_balance field 25.00 Now, I've hit a bit of a roadblock with getting the MySQL query format correct. The SIGNUP_DATE field in the database is DATETIME format and the like with wildcard thing isn't working for me. Is there anyone who can point me in the right direction with the proper wildcard date format? It'd be a great help. Anything at all is massively appreciated. Here's the code I have so far...the echo is in there so I can see if it's working correctly. I'm pretty sure I haven't got the right function to display the result of the query either but I think I can figure that out pretty easily. <?php $today = date("Y-m-d"); mysql_connect("localhost", "DBUSER", "DBUSER") or die(mysql_error()); mysql_select_db("DBNAME") or die(mysql_error()); $sql1 = mysql_query("SELECT USER_NAME FROM members WHERE SIGNUP_DATE LIKE '$today%"); if($sql1 == false) { user_error("Query failed: " . mysql_error() . "<br />\n$query"); } elseif(mysql_num_rows($sql1) == 0) { echo "<p>Sorry, no rows were returned by your query.</p>\n"; } $memberseligible = mysql_fetch_array($sql1); echo "$memberseligible"; ?>
×
×
  • 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.