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?
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
}
?>
Class not found error
I am getting Class 'index' not found in Eval function://write config $path = dirname(__FILE__).DS.'..'.DS.'paymentclass'; if ( $model->payment_class ) { if
PHP, jAVASCRIPT setting input values, why isn't it working?
Hi:I am calling this javascript:<script language="javascript">function set_item_values(x){document.forms.form1.GetElementById(x).value =
Mysql query, two times?
Hello to all,I'm new to php coding and i like it alot. I need help with some noob stuff.1. Having problem with mysql query after submiting HTML form. It's allways execuding two times, that way i have
[newb] Image hosting help.
Hey there, I'm new to php, I know some basics and i can code PWN, I'm only 14 but I'm interested in PHP, I have bought a dedicated server, (With unlimited bandwidth of corse, And 2tb Hard drives), And
Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO principles. I've started reading OOP tutorials including the design patterns. And John is right, this
File upload issues
Hi Guys,Can anyone see any issues with this code:Code: $setImage= 'productimages/' . date(U) . $HTTP_POST_FILES['setImage']['name'][0];copy($HTTP_POST_FILES['setImage']['tmp_name'][0], $setImage);Its
My query is being run with no results.
I have this.Code: function DropUser($duser_id, $user_email, $user_username) { if(isset($_SESSION['admin_username']) && isset($_SESSION['admin_id']) &&
Material Issuing for receiving batch
Dear All experts in MM/ PP,
Stopped working!
So I had to change some stuff, none of it major. Stuff like the extension_dir and such. BEFORE I did much, I had that code working fine. Then I did some changed... well a lot of changes that I cant
Creating web pages by php
Hello again,I was just wondering us there a way to use a php script to create a new web page. I guess the best example is something like YouTube where when a video is uploaded, it's assigned a new