Jump to content

Omael

New Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Omael

  1. I changed my query to this and it now works: mysql_connect($theserver,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT column1, column2 FROM questions WHERE questionid = '$_GET[qid]'"; $result1=mysql_query($query); $num1=mysql_numrows($result1); while ($row = mysql_fetch_assoc($result1)) { $column1=$row['column1']; $column2=$row['column2']; } mysql_close();
  2. Hmm. I'm getting invalid ID when i try that.
  3. I have a simple query, but for some reason when I display the value of two columns they both return the value of the first column. Syntax: [ Download ] [ Hide ] [ Select ] <?php mysql_connect($theserver,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT column1, column2 FROM questions WHERE id = '$_GET[id]'"; $result1=mysql_query($query); $num1=mysql_numrows($result1); mysql_close(); $colum1=mysql_result($result1,"column1"); $column2=mysql_result($result1,"column2"); ?> <?php echo $column1; ?> <?php echo $column2; ?> For some reason column 2 displays the same value as column 1 but they have different values.
×
×
  • 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.