Jump to content

T_Logical_OR Parse error. Help is appreciated.


todayme

Recommended Posts

I have this error below, anyone got any ideas, I am sure it is a simple syntax error.

 

Parse error: syntax error, unexpected T_LOGICAL_OR in /home/admin/domains/sold.au.com/public_html/getlocation.php on line 16

 

 

<?

//set the variables as required

$dbhost = "localhost";

$dbuser = "admin_sex";

$dbpass = "sex";

$dbname = "admin_sex";

 

 

 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass);

mysql_select_db($dbname) or die(mysql_error());

 

 

 

$data = mysql_query("SELECT * FROM _Industries WHERE Industry = '$dbIndustry'");

or die(mysql_error());

 

$info = mysql_fetch_array( $data );

 

$locationtype = $info['Location_Type'];

 

?>

<select name="Location"

><?php

 

  $query=mysql_query("("SELECT '$dbState' FROM '$locationtype'");

  while ($fetch=mysql_fetch_assoc($query)) {

    echo '<option value="'.$fetch['$dbState'].'">'.$fetch['$dbState'].'</option>';

  }

mysql_close($db);?></select>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<?php
//set the variables as required
$dbhost = "localhost"; 
$dbuser = "admin_sex"; 
$dbpass = "sex"; 
$dbname = "admin_sex"; 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname) or die(mysql_error());

$data ="SELECT * FROM _Industries WHERE Industry = '$dbIndustry' ";

$result1=mysql_query($data)or die("mysql_error()");

$info = mysql_fetch_array( $result1); 

$locationtype = $info['Location_Type']; 

?>
<select name="Location" >

<?php

  $query="SELECT '$dbState' FROM '$locationtype'";
  $result2=mysql_query($query) or dir("mysql_error()");
  
  while ($fetch=mysql_fetch_assoc($result2)) {
    echo '<option value="'.$fetch['$dbState'].'">'.$fetch['$dbState'].'</option>';
  }
mysql_close($db);?></select>

Geting closer now I have this error after trying your code.

 

I am looking looking looking ha ha.

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/admin/domains/sold.au.com/public_html/getlocation.php on line 19

what?

sorry corrected.

<?php
//set the variables as required
$dbhost = "localhost"; 
$dbuser = "admin_sex"; 
$dbpass = "sex"; 
$dbname = "admin_sex"; 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname) or die(mysql_error());

$data ="SELECT * FROM _Industries WHERE Industry = '$dbIndustry' ";

$result1=mysql_query($data)or die("mysql_error()");

$info = mysql_fetch_array( $result1); 

$locationtype = $info['Location_Type']; 

?>
<select name="Location" >

<?php

 $query="SELECT '$dbState' FROM '$locationtype'";
 $result2=mysql_query($query) or die("mysql_error()");
 
 while ($fetch=mysql_fetch_assoc($result2)) {
   echo '<option value="'.$fetch['$dbState'].'">'.$fetch['$dbState'].'</option>';
 }
mysql_close($db);?></select>

Here is the correct code incase anyone wants it.

 


<?php
//set the variables as required
$dbhost = "localhost"; 
$dbuser = "admin_sex"; 
$dbpass = "sex"; 
$dbname = "admin_sex"; 

$db = mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db($dbname) or die(mysql_error());

$data ="SELECT * FROM _Industries WHERE Industry = '$dbIndustry' ";

$result1=mysql_query($data)or die("mysql_error()");

$info = mysql_fetch_array( $result1); 

$locationtype = $info['Location_Type']; 




?>
<select name="Location" >

<?php

  $query=mysql_query("SELECT $dbState FROM $locationtype");
  while ($fetch=mysql_fetch_assoc($query)) {
    echo '<option value="'.$fetch[$dbState].'">'.$fetch[$dbState].'</option>';
  }
mysql_close($db);?></select>

[code/]

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.