Jump to content

[SOLVED] php/mysql query questions


herghost

Recommended Posts

Hi all,

 

I have two questions, both of which ill run once a month from a cron script.

 

1, How can I empty a table called users_stocks_details from PHP?

2, In the users_stocks_detils table I have the following coloums:

 

user_id  stock_id  quant

 

Once this has been emptied I want to add every users id that has 10 or more credits (see below) with the stock_id of 0 and the quant of 100.

 

I have this so far but not sure where to go with it!:

 

$query="SELECT credits FROM users_details";
  $result = mysql_query($query, $conn) or die(mysql_error($conn));
$rows = mysql_fetch_array($result);
extract($rows);
  
  

  if ($rows['credits'] => 10)
  {

 

Many Thanks

Link to comment
https://forums.phpfreaks.com/topic/180086-solved-phpmysql-query-questions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.