Jump to content
  • Advertisement

Archived

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

demonrealms

What's wrong with this?

This topic is 5421 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This code won''t work for some reason anyone know y? It''s always worked with me before. But now it''s deciding to be a b***.
<?php
$usrid;
$usrpass;
$f_log = 0;
if($sendit) {
$dbh=mysql_connect ("localhost", "*******", "*******") or die (''I cannot connect to the database because: '' . mysql_error());
mysql_select_db ("demonrea_email"); 

$sql2 = "SELECT * FROM sathenzar";
$result2 = mysql_query($sql2, $dbh);
while($row2 = mysql_fetch_array($result2)) {
$sbj = $row2[ ''subject'' ];
$from = $row2[ ''usr'' ];
echo "<h4>$sbj      |   $from</h4><br />\n";
echo "<tr>\n";
echo "<td style=''border: 1px solid lightblue'' valign=top align=left>\n";
echo "</td>\n";
echo "</tr>\n";
?>
Thanks, demonrealms

Share this post


Link to post
Share on other sites
Advertisement
what exactly is the problem? need some more detail. And is $sendit being initialized? I''m assuming it''s coming from the url. what version of php are you using? i think that may not work any more in versions above 4(???), i''m not sure tho, i haven''t used php in months. use either $_GET or $_POST depending on your needs.

Kory Spansel

Share this post


Link to post
Share on other sites
The query looks fine. Is the database name correct? How about the table name? Try executing the query on the mysql command-line and see what you get.

Kory Spansel

Share this post


Link to post
Share on other sites
Try This...

~~~~~~~~(Just The Beginning Of Your Code)~~~~~~

$f_log = 0;
if($sendit) {
$dbh=mysql_connect ("localhost", "*******", "*******") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("demonrea_email");

$result2 = mysql_query("SELECT * FROM sathenzar");
while($row2 = mysql_fetch_array($result2)) {

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You don't really need to put those two variables you had at the beginning unless you're actually setting them to something... If that doesn't work, it would help knowing the exact error it gives you.

Whats the code to make the source box appear?

[edited by - Ketay on January 14, 2004 7:40:00 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!