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
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.
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
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) {//... closedAnother 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