Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.