Getting Resource id #11 while trying to connect..
Posted on
16th Feb 2014 07:03 pm by
admin
So i tried using "DEFINE" for the first time and im using the variables i defined to connect but it reports back this error:
QuoteWarning: mysql_query(): 11 is not a valid MySQL-Link resource in /home/content/p/p/f/ppffffpp/html/avalancheatblue.com/nc-cms/system/modules/storage/mysql.php on line 25
Can anyone look at the function and find out why this is?
Did you know?Explore Trending and Topic pages for more stories like this.
Code: (php) [Select]<?php
function nc_save_content ($name, $data)
{
$nc_db_link = mysql_connect(NC_DB_HOST, NC_DB_USER, NC_DB_PASSWORD);
$nc_db_link = nc_db_link($nc_db_link, NC_DB_DATABASE);
$x=3;
while($x != 0){
nc_check_content($name.$x, "Edit Me History" . $x);//line 9-14 making sure the history exists (if not creates it)[function is internal]
$x--;
}
//Now start backwards and work from 2-0 moving files for history
$x=2;
$z=1;
while($x != 0){
$temp2 = $name.$x;
$get = "SELECT content FROM " .NC_DB_PREFIX."content WHERE name ='".$temp2."'";
$res = mysql_query($get,$nc_db_link) or die (mysql_error());
$row = mysql_fetch_assoc($res);
$temp = $x + 1;
$insert = "UPDATE ".NC_DB_PREFIX."content SET content='".$row['content']."' WHERE name='".$name.$temp."'";
$res2 = mysql_query($insert,$nc_db_link) or die (mysql_error());
$x--;
}
//one last thing move the current entry to 1 before we overwrite it!!!
$sql = mysql_query("SELECT content FROM " .NC_DB_PREFIX."content WHERE name ='".$name."'",$nc_db_link) or die (mysql_error());
$row = mysql_fetch_assoc($sql);
$insert = mysql_query ("UPDATE ".NC_DB_PREFIX."content SET content='".$row['content']."' WHERE name='".$name."1"."'",$nc_db_link) or die (mysql_error());
nc_check_content ($name, "Edit Me!"); // Make sure database entry exists
$nc_db_result = mysql_query("UPDATE ".NC_DB_PREFIX."content SET content='".nc_db_escape($data)."' WHERE name='".$name."'", $nc_db_link);
if(!$nc_db_result) // Check for query errors
{
nc_report_error("MySQL reported: ".mysql_error());
exit();
}
mysql_close($nc_db_link); // Close connection
}
?>
No comments posted yet
Your Answer:
Login to answer
251
8
Other forums
pass form variables straight to email, no database required?
hello all,
im working on this form...
http://www.adobedayevents.com/project_request/pr
PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database ass
admin with my register system?
Hey i wana make it so i can make a admin level on my register system , I'm kinda new to php to im no
ALV List display - header width adjust
Hi,
I am using REUSE_ALV_LIST_DISPLAY for my ALV display.The width of the ALV varies for
Check Digits and extracting digits
I think I can figure out the code for this but I am having a very hard time getting past the first s
Appending GET data with form submition
Okay, what I'm trying to do is to use a form to append an already existing GET data string.
I
phpMailer not working ..........
HI,
I was playing with the phpMailer script and tried to send a smiple mail using their test scri
Image DPI
Hi.
I allow users to upload images, the user then is able to adjust several settings for the
Help with captcha script needed
Hello,
I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f