Code: <?
## CONNECT TO DB FUNCTION!
function ConnectTo($db2con)
{
$hostName = "localhost";
$dbName = "people_".$db2con;
$userName = "people_main";
$password = "normal123";
$link = mysql_connect($hostName, $userName, $password) or die("Unable to connect to host $hostName");
mysql_select_db($dbName, $link) or die( "Unable to select database $dbName");
return $link;
}
$conn = ConnectTo("estore");
$query = "SELECT * FROM CubeCart_inventory";
$result = mysql_query($query) or die(mysql_error());
$num = mysql_num_rows($result);
while ($row=mysql_fetch_array($result)) {
$prod = $row['productId'];
$cat = $row['categories'];
}
?>
I have the above code ... EVERYTIME it runs I get this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/people/public_html/code/xml/scripts/loadCatIDx.php
I do not understand this problem! I understand the error is implying my query returned an error, however when I add echo mysql_num_rows($result) it returns over 2700 records ...
Any help would be greatly appreciated!!
Sorting JTable on more than just the values listed in the columns
I have a collection of objects that store (among other things) two integer values. I only want to display one of these values. The displayed value will dictate the sort order of the JTable.However, I
OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables and return which variable that was randomized and output it.Code: <?phpclass hit_chance {
DBCA Templates
Hi all,I'm working on creating a template for DBCA, but can't find any documentation on the parameters that one can use within the template. Obviously most are fairly obvious, but I'd like to see
PHP referral database. I would like this form to email the referrer.
Okay, Hello I've been trolling for years. This the first time I've ever asked for php help. Normally my questions seem so amateur when I finally find theanswer on my own. But this is making me pull my
"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the From field. I need the email that is sent to be "From" the email that the sender input.
Edit MySQL Row Using PHP and HTML Form
Hello,Here's what I'm trying to do. Build a page where a user enters a MySQL row number in. Then, a new page appears with an HTML form where the user can edit the information in that row. Like for
firefox wouldnt stream mp3 files completely from my php page
hi everyone,I have a php file trying to read and stream mp3 files. It works fine in IE but my problem is Firefox streams only 3 seconds of them.$direction =
Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and some links . but those sessions are not working correctly when some one sign in and sign out and
Packet Design
Hi All,Im new about network programming and I want to design a protocol but I have some questions about packet desing. For example I wanna do a sturct to send informations like that ;struct info {
Table control is disappearing from Screen
Hi Experts,