Forum Moderators: coopster
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/getbalan/public_html/suscribete.php on line 66
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/getbalan/public_html/suscribete.php on line 68
I have no idea what it could be.
This is the code of those lines (from 66 to 70)
[php]
mysql_select_db($database_MySQL, $MySQL);
$query_Sexos = "SELECT * FROM wlu_sexo";
$Sexos = mysql_query($query_Sexos, $MySQL) or die(mysql_error());
$row_Sexos = mysql_fetch_assoc($Sexos);
$totalRows_Sexos = mysql_num_rows($Sexos);
?>
[/php]
Just a few lines above, in lines 51-52, there's a very similar code and it doesn't seem to have any problem:
[php]
mysql_select_db($database_MySQL, $MySQL);
$Result1 = mysql_query($insertSQL, $MySQL) or die(mysql_error());
?>
[/php]
Please help me out with this one. I'm really clueless.
Welcome to WebmasterWorld!
I think you're missing one important function in your script:
mysql_connect [php.net]();
That goes before mysql_select_db().
Birdman
But when I generate the code with dreamweaver it doesn't use that function:
<php>
<?php require_once('Connections/MySQL.php');?>
<?php
mysql_select_db($database_MySQL, $MySQL);
$query_Recordset1 = "SELECT * FROM wlu_nuprograma";
$Recordset1 = mysql_query($query_Recordset1, $MySQL) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
</php>
What really confuses me is that all the pages work fine in my server, but when I upload them all the problems come in to view.
<?php require_once('Connections/MySQL.php');?>
What you need to do is, 1) Make sure the above file is uploaded 2) Make sure the path to the file is correct 3) Make sure the login info is correct in the file.
The safest way is to use this:
require_once($_SERVER["DOCUMENT_ROOT"] . "/Connections/MySQL.php");
That assumes there is a /Connections/ folder sitting in the public root folder.