Good day, I just returned to my old subject, Computer Science. And i really need your help, i already start up a little codings but with this problem in loading up subjects.
i just give you my project
https://drive.google.com/file/d/0B5qSnjDxuNSnTEZUUXRwWDdUcU0/view?pref=2&pli=1 hopely someone could do a big refreshing to my language skill.

Recommended Answers

All 3 Replies

Posting links like that here is frowned upon as we have no way to know if it will infect our system with a trojan. Please post the requirements, code, and such here directly.

<?php
if
(isset($_REQUEST['update']))
{   
@$db = mysql_connect("localhost","root","");
mysql_select_db("student",$db);
$sql = ""; // heres the problem, i couldn't get any referrence on how i function a loading up button.
$result = mysql_query($sql);
}
else if (isset($_REQUEST['delete']))
{
@$db = mysql_connect("localhost", "root","");
mysql_select_db("student",$db);
$sql = "DELETE from admission WHERE id='$_POST[id]'";
$result = mysql_query($sql);
}
@mysql_connect("localhost", "root","");
mysql_select_db("student") or die(" could not connect to DB");
$sql = "SELECT * from subject,admission";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{       
?>

</>
heres the code sir, i intently make it this way like a funtion button. i already specify the line of my inquiry. thank you sir.

Member Avatar for diafol

OK. Few things.
1. Specify a superglobal (POST or GET) rather than depend on REQUEST. As you are making changes to the DB, you should use POST.
2. Stop using mysql_* functions. They are deprecated (and now removed from PHP7). Use PDO or mysqli.
3. You are placing raw input data into a statement without sanitizing. This means you are open to SQL Injection.

See DW Tutorial: Common Issues with MySQL and PHP for how to fix these issues.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.