Jump to content

Php Application


Hydrian

Recommended Posts

I get Resource id #10 when i load my page

 

 

Full Script

<?php

session_start();
include 'config.php';

mysql_select_db("my_db");

$result = mysql_query(" SELECT * FROM `categorys`, SELECT * FROM `topics` ");	


?>
<?php include 'header.php'; ?>
	<div id="nar">
		 
	</div>
        <div id="content">
	<?php print $result; ?>
	</div>
	<div id="nar">
		 
	</div>
<?php include 'footer.php'; ?>

Link to comment
Share on other sites

I get 

mysql_fetch_assoc(): 

supplied argument is not a valid MySQL result resource. when i load the page

 

<?php

session_start();
include 'config.php';

mysql_select_db("my_db");

$result = mysql_query("SELECT * FROM `categorys`, SELECT * FROM `topics` ");	

while ($row = mysql_fetch_assoc($result)) {
	echo $row["cat_name"];
}


?>

Link to comment
Share on other sites

At this point I think you really should reconsider your choice of hobby. Either that or you need to start paying attention to stuff and actually try to learn, instead of just writing random stuff and expecting things to work without having to put forth the effort to understand why things work as they do.

Link to comment
Share on other sites

Im working on the login stuff

 

I get an unexpected '=' on line 9

 

<?php

session_start();
include_once('connect.php');

if (isset($_POST['username'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$sql = " SELECT * FROM members WHERE username='".$username."'" AND password='".$password." LIMIT 1';
$res = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($res) == 1) {
	$row = mysql_fetch_assoc($res);
	$_SESSION['uid'] = $row['id'];
	$_SESSION['username'] = $row['username'];
	header ("Location: index.php");
	exit();
} else {
	echo "Invalid login information. Please return to previous page.";
	exit();
}
}

?>

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.