/    Sign up×
Community /Pin to ProfileBookmark

Why wont someting as simple as this work? it’s al blank

[code=php]<?
include “config.php”;
?>
<?php

$open = “SELECT * FROM open WHERE id = ‘1’”;

$result = mysql_query($open);

echo $result[‘openclosed’];[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NvenomJul 31.2011 — are u getting any errors?

if not use this
[code=php]
<?php
include "config.php";
?>
<?php

$open = "SELECT * FROM open WHERE id = '1'";

$result = mysql_query($open) or die(mysql_error());

echo $result['openclosed'];
[/code]


also make sure the connection is set up right in config.php im guessing thats where your

[code=php]
mysql_connect("127.0.0.1", "root", "pass") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
[/code]


is.

remember to use the right tags
[code=php]
<?php ?> //USE these Tags
<? ?> //DONT Use these
[/code]
×

Success!

Help @evania spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 9.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @ddiebold17,
tipped: article
amount: 1000 SATS,

tipper: @Mqlinka19,
tipped: live stream
amount: 4900 SATS,

tipper: @Mqlinka19,
tipped: article
amount: 10 SATS,
)...