•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,043 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 1994 | Replies: 31 | Solved
![]() |
Also -
You are saying If $res is not == "" then echo "Nothing in Recordset" else ...
So if $res has anything in it, you will get the "Nothing" message.
if( $res !== "" ) {
echo "Nothing in recordset.";
} else {
echo "Something in recordset.";
} You are saying If $res is not == "" then echo "Nothing in Recordset" else ...
So if $res has anything in it, you will get the "Nothing" message.
i tried the code you just put up and it gives me the same reply as before telling me there is nothing the database.
how can this be when i test the save to data base and it says it is saving the data that is needed. the as the data is being saved to the database it is stored in a variable called $sContent should i use the variable name when recalling the data in stead of the column name?
i will try this i see what the result is.
how can this be when i test the save to data base and it says it is saving the data that is needed. the as the data is being saved to the database it is stored in a variable called $sContent should i use the variable name when recalling the data in stead of the column name?
i will try this i see what the result is.
i have changed the part of the code where it is asked to display the answer if there is something in the record set and changed the editorial to and it now says there is something and the message it leaves looks like this
There is something!CREATE TABLE cms_core ( editroial longblob id int )
why is the create table part showing up is this meant to?
$sContent
There is something!CREATE TABLE cms_core ( editroial longblob id int )
why is the create table part showing up is this meant to?
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,057
Reputation:
Rep Power: 8
Solved Threads: 229
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,057
Reputation:
Rep Power: 8
Solved Threads: 229
Then obviously, the table has records. What do you want exactly ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,057
Reputation:
Rep Power: 8
Solved Threads: 229
And you don't have that syntax error anymore. Right ? Now, if that solves your problem, well and good. If it doesn't, you need to be specific about your problem.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
the code for saving it to the database is
and the code i have used to recall the data from the database is
if you need anymore let me know.
include ('../includes/db_inc.php');
// save content to db
if(isset($_POST["inpContent"]))
{
$sContent=stripslashes($_POST['inpContent']); // remove slashes (/)
$sContent=ereg_replace("'","''",$sContent); // fix SQL
$sql="UPDATE cms_core SET editorial='$sContent' WHERE id=$id";
$query = mysql_query($sql);
}and the code i have used to recall the data from the database is
$SQL = "SELECT '$sContnet' FROM cms_core WHERE id= '1' ";
$res = mysql_query($SQL,$db);
if(mysql_num_rows($res) > 0){
echo "There is something!";
} else {
echo "Nothing !";
}
echo $sql;if you need anymore let me know.
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,057
Reputation:
Rep Power: 8
Solved Threads: 229
Update query is correct. But select query is wrong.
You can use this.
mysql Syntax (Toggle Plain Text)
SELECT * FROM cms_core WHERE id= '1'
You can use this.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
- mysql loading txt file to mysql db????????? (MySQL)
- inserting checkbox values in mysql +PHP (PHP)
- MySQL/PHP UPDATE Syntax error (MySQL)
- php and mysql insert...where making me tear my hairs out!!! help!!! (PHP)
- MySQL installation problem (*nix Software)
- Problem with MySQL Query (Database Design)
- Please help me out with MySQL query (MySQL)
- Error "Syntax" (Windows 9x / Me)
Other Threads in the MySQL Forum
- Previous Thread: Access denied when connecting to db
- Next Thread: i need help



Linear Mode