turn reg link on and off wapdesire v_2 script

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

24 replies · 1,494 views · started 15 years ago · 1 min read

TL;DR · summary of 24 replies
  • - The fix involves changing the value of $results["reg"] to $results["registration"] in the code.
  • - The main page message should be added where the registration link is currently displayed, showing a message instead of redirecting to the register.php page when the registration feature is turned off.
  • - The error "mysql_fetch_array(): supplied argument is not a valid MySQL result resource" suggests there might be an issue with how data from the database is being fetched and used in the code.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

8 participants
woody Developer · 176 posts #21
$results = mysql_query("select reg FROM settings");
$registration = mysql_fetch_array($results);
if($registration["reg"]==1){
$main.="> <a href=\"./register.php\">Register Free</a><br/>";
} else {
$main.="reg turned off please try later";
}
arnage Lead · 811 posts #22

brand wrote: thanks for helping arnage i have tryed what you have said bit still not working

But its was just an example, change vaule of $results["reg"] to $results["registration"], thats the table name. I checked now because i don't use those scripts so didn't know. 🙂

INSERT INTO `settings` VALUES(6, 'registration', '1');

1 - allowed, 0 - closed. And there is nothing not to work, this way we select array from settings using mysql_fetch_array() to read and use the data:

$results = mysql_fetch_array(mysql_query("SELECT * FROM `settings`"));

... and its stored in:

if ($results['registration'] == 0) {//... closed

Another way with same result is to read that one cell:

$results = mysql_result(mysql_query("SELECT `registration` FROM `settings`"), 0);

... so:

if ($results == 0) {//... closed
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
brand Senior · 391 posts #23

arnage wrote: But its was just an example, change vaule of $results["reg"] to $results["registration"], thats the table name. I checked now because i don't use those scripts so didn't know. 🙂

INSERT INTO `settings` VALUES(6, 'registration', '1');

1 - allowed, 0 - closed. And there is nothing not to work, this way we select array from settings using mysql_fetch_array() to read and use the data:

$results = mysql_fetch_array(mysql_query("SELECT * FROM `settings`"));

... and its stored in:

if ($results['registration'] == 0) {//... closed

Another way with same result is to read that one cell:

$results = mysql_result(mysql_query("SELECT `registration` FROM `settings`"), 0);

... so:

if ($results == 0) {//... closed

thanks for ya help but i got it now thanks very much

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

Guest #24

Bravo drug 😛... title = Welcome to Smarty! cutoff_size = 40

[setup] bold = true

eynesilli Junior · 22 posts #25

Thank you all who contributed to friends

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close