Jump to content

Having some troubles


blufish

Recommended Posts

theres an error on line 11 which I think is due to having to have 3 different kinds of quotation marks.  when I remove one of them I get errors on lines 12 and 13 which I think are directly related to the line 11 problem.  If you have any tips on how to fix this, please help me.

<?php
echo "<html><head><title>Account Creation...</title></head><body bgcolor='#cccccc' alink='black' vlink='gray' link='white'><b>";
$con = mysql_connect("www.frozenoven.com", "blufish_fart", "pants");
$finddb = mysql_select_db("blufish_frozenusers", $con);
if(!$con || !$finddb)
  {
  die('Could not connect: ' . mysql_error());
  }

$_POST['name'] = addslashes(htmlspecialchars($_POST['name']));
$chex = mysql_query("SELECT * FROM 'users' WHERE 'name'="'. $_POST['name']."'");
$asdf = mysql_num_rows($chex);
$array = mysql_fetch_array($chex);
if ($array['cherk']=="" && $asdf != 1)
{
$sql = "INSERT INTO users (name,paas,cherk,wideone,widetwo,widethree,widefour,widefive,widesix,wideseven,wideeight,widenine,wideten) VALUES('$_POST[name]','$_POST[paas]','$_POST[name]'),'<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->')";
if (!mysql_query($sql,$con))
  {
  die("<div style='text-align: center;'>Error: ". mysql_error() ."</div>");
  }
echo "<center>Account Created</center><BR><BR><p>To customize your page, please click <a href='customize.htm'>here</a>.";
}
else
{
echo 'Account name already in use.';
}
mysql_close($con);
?>

Link to comment
https://forums.phpfreaks.com/topic/105703-having-some-troubles/
Share on other sites

The code I'm currently using

 

<?php
echo "<html><head><title>Account Creation...</title></head><body bgcolor='#cccccc' alink='black' vlink='gray' link='white'><b>";
$con = mysql_connect("www.frozenoven.com", "blufish_fart", "pants");
$finddb = mysql_select_db("blufish_frozenusers", $con);
if(!$con || !$finddb)
  {
  die('Could not connect: ' . mysql_error());
  }

$_POST['name'] = addslashes(htmlspecialchars($_POST['name']));
$name=mysql_real_escape_string($_POST['name']);

$sql="SELECT * FROM users WHERE name='$name'";
$sql_reult=mysql_query($sql)or die(mysql_error());
$asdf = mysql_num_rows($chex);
$array = mysql_fetch_array($chex);
if ($array['cherk']=="" && $asdf != 1)
{
$sql = "INSERT INTO users ($name,paas,cherk,wideone,widetwo,widethree,widefour,widefive,widesix,wideseven,wideeight,widenine,wideten) VALUES('$_POST[name]','$_POST[paas]','$_POST[name]'),'<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->','<!--None-->')";
if (!mysql_query($sql,$con))
  {
  die("<div style='text-align: center;'>Error: ". mysql_error() ."</div>");
  }
echo "<center>Account Created</center><BR><BR><p>To customize your page, please click <a href='customize.htm'>here</a>.";
}
else
{
echo 'Account name already in use.';
}
mysql_close($con);
?>

 

Is giving me the following errors:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/blufish/public_html/test/signing.php on line 15

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blufish/public_html/test/signing.php on line 16

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''','','','','','

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/105703-having-some-troubles/#findComment-541585
Share on other sites

I fixed the result problem but now I get these errors:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/blufish/public_html/test/signing.php on line 15

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blufish/public_html/test/signing.php on line 16

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''','','','','','

 

What do you mean by post thingy can you explain?

I think you mean $_POST but I don't understand where is it and what is wrong?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/105703-having-some-troubles/#findComment-541613
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.