Jump to content

mysql help...


somo

Recommended Posts

im gettin a parse errror


$result = mysql_query( "SELECT R_RoomAvailiability FROM Room WHERE R_ID=$R_ID " )
<b>$row = mysql_fetch_assoc($result);  <---error is here for some reason</b>
$R_RoomAvailability = $row['SELECT R_RoomAvailiability'];

[quote author=ShogunWarrior link=topic=99971.msg394044#msg394044 date=1152461113]
Ok, first I think R_ID is probably a number so you don't need quotes, e.g: [b]$R_ID[/b] instead of [b]'$R_ID'[/b]

To get the values do this:
[code]
$row = mysql_fetch_assoc($result);
$R_Room_Availability = $row['SELECT R_RoomAvailiability'];
[/code]
[/quote]
Link to comment
https://forums.phpfreaks.com/topic/14103-mysql-help/#findComment-55206
Share on other sites

Try this:

[code]<?php
$result = mysql_query("SELECT R_RoomAvailiability FROM Room WHERE R_ID = ".$R_ID." LIMIT 1") or die(mysql_error());
$row = mysql_fetch_assoc($result);  //<---error is here for some reason
$R_RoomAvailability = $row['SELECT R_RoomAvailiability'];
echo $R_RoomAvailability;
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/14103-mysql-help/#findComment-55208
Share on other sites

Another error lol

Undefined index: SELECT R_RoomAvailiability

$result = mysql_query("SELECT R_RoomAvailiability FROM Room WHERE R_ID = ".$R_ID." LIMIT 1") or die(mysql_error());
$row = mysql_fetch_assoc($result);
<b>$R_Room_Availability = $row['SELECT R_RoomAvailiability']; //<-- error here now :( </b>

[quote author=Gast link=topic=99971.msg394049#msg394049 date=1152462035]
Try this:

[code]<?php
$result = mysql_query("SELECT R_RoomAvailiability FROM Room WHERE R_ID = ".$R_ID." LIMIT 1") or die(mysql_error());
$row = mysql_fetch_assoc($result);  //<---error is here for some reason</b>
$R_RoomAvailability = $row['SELECT R_RoomAvailiability'];
echo $R_RoomAvailability;
?>[/code]

[/quote]
Link to comment
https://forums.phpfreaks.com/topic/14103-mysql-help/#findComment-55213
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.