Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Access Denied

Featured Replies

Getting Access denied with this code

$link=mysql_connect("localhost","root","root")or die(mysql_error( ));

mysql_select_db("bwi",$link) or die(mysql_error( ));

$result=msql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( ));

What password and ussername do I have to use with mysql_connect???????????????????????????????????

I haven't changed them and Uniserver is running on thumb drive. :rolleyes:

$result=msql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( ));

Is that call supposed to be mysql_query() instead? This might be your problem.

 

You can use root/root if that's what you still have configured, but that also means you're wide open to attack, because it's NOT secure. You should set up a restricted user (through phpMyAdmin), and assign that user to the specific database. The user should have select, insert, update, and delete at a minimum.

 

Regards,

BobS

  • Author

BobS

You could be right, I'll check it out, should be mysql_query() first, then $result but acctualy the whole script runs like this and draws the error in the div designated for the http response :rolleyes:

<?php

$link=mysql_connect("localhost","root","root")or die(mysql_error( ));

mysql_select_db("bwi",$link) or die(mysql_error( ));

$query=mysql_query("SELECT Code,Item,Description,Href,Src FROM silver")or die(mysql_error( ));

echo "<table border='1'>
<tr>
<th>Code</th>
<th>Item</th>
<th>Description</th>
<th>Href</th>
<th>Src</th>
</tr>";

while($row = mysql_fetch_array($query))// could be msql_fetch_row($query) ???
{
echo "<tr>\n";
echo "<td>" . $row['Code'] . "</td>\n";// don't know if new line is required?
echo "<td>" . $row['Item'] . "</td>\n";
echo "<td>" . $row['Description'] . "</td>\n";
echo "<td>" . $row['Href'] . "</td>\n";
echo "<td>" . $row['Src'] . "</td>\n"; // don't know if it should be $row[5] ref?
echo "</tr>";
}

echo "</table>";

mysql_close($link);
?>

 

Sorry BobS I think your right that this is not the place for tutorials but I need to know UniServer is working properly before I proceed.

  • Author
:) Hay Coral, BobS was right and it worked, the div innerHTML gets the output from query the only thing is that the getSilver.php returns the #comment at the top of the php page along with the table. Is there a way to write the SELECT that dosen't return the #Comment in the php page? :rolleyes:

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.