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
https://forums.phpfreaks.com/topic/268009-php-application/
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
https://forums.phpfreaks.com/topic/268009-php-application/#findComment-1375384
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
https://forums.phpfreaks.com/topic/268009-php-application/#findComment-1375389
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
https://forums.phpfreaks.com/topic/268009-php-application/#findComment-1375392
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.