Jump to content

PHP help - Admin notepad


deano2010

Recommended Posts

Hey,

I really new to php and am looking for some help with a php notepad which it will store notes in a database..

 

I have been searching for a few hours and all i can seem to find is that program notepad++ or some scripts which are complicated.

 

Can you help me by posting the php database mysql query and php code for the notepad..

I would be very grateful if you could help me out.

 

Thanks

Deanow2010

Link to comment
Share on other sites

It would be easier to help if you found a script that you liked and posted what you couldn't figure out to do. I don't think anyone on this site is going to write you an entire script for free, but we will gladly help you with some smaller issues.

 

Its just a couple of lines of php in a form is what i need and the mysql query ...

Not a full entire script..

 

Link to comment
Share on other sites

Its just a couple of lines of php in a form is what i need and the mysql query ...

Not a full entire script..

 

If you do not understand such basic tasks, the methodology is simple (escaping and storing a POST form into a query after escaping/sanitizing it), but it can't be done without you not knowing how to accomplish most of these tasks first.

Link to comment
Share on other sites

you said you wanted just the queries so here's a start:

 

CREATE TABLE Notepad ( ID INT AUTO_INCREMENT PRIMARY KEY, Note TEXT );

 

INSERT INTO Notepad SET Note="This is an admin note"

 

Thanks but would you be able to give me the php too  :D

Link to comment
Share on other sites

you said you wanted just the queries so here's a start:

 

CREATE TABLE Notepad ( ID INT AUTO_INCREMENT PRIMARY KEY, Note TEXT );

 

INSERT INTO Notepad SET Note="This is an admin note"

 

Thanks but would you be able to give me the php too  :D

 

$Query = 'CREATE TABLE Notepad ( ID INT AUTO_INCREMENT PRIMARY KEY, Note TEXT );';

$Result = mysqli_query($Connection, $Query);

if ( !$Result ) { die("Error running mysql query."); }

 

$Query = 'INSERT INTO Notepad SET Note="This is an admin note"';

$Result = mysqli_query($Connection, $Query);

if ( !$Result ) { die("Error running mysql query."); }

 

$Query = 'SELECT Note FROM Notepad ORDER BY ID DESC LIMIT 1';

$Result = mysqli_query($Connection, $Query);

if ( !$Result ) { die("Error running mysql query."); }

$Row = mysqli_fetch_array($Result);

echo 'Newest admin note: ' . $Row['Note'];

 

that gives you an idea, but honestly you really need to go read some basic mysql and php tutorials.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.