Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

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.

MySQL Undefined Index

Featured Replies

Hey guys me again.

 

Atm I'm receiving undefined index when I try to echo out a table.

 

Mine code;

 

<?php
include("config.php");

$sql=mysql_query("SELECT post FROM news");
$rij=mysql_fetch_array($sql);
$row=mysql_fetch_assoc($sql);

echo $row['number'];

echo $rij['number'];
echo $rij['post'];
echo  "<br>";


?>

 

Number table setting;

Column; number

Type; INT

Length/Values;255

Auto_Increment; (tried it both on yes and no)

 

Anyone have any idea or must I echo it out in a different way?

using var_dump() would save the need to post messages like this again.

 

http://uk3.php.net/var_dump

 

 

Also look at the documentation for the functions your trying to use as they have code samples on how to use them.... the php manual is probbly one of the best dev docs ive used.

 

http://uk.php.net/mysql_fetch_assoc

Edited by SniderDK

Hey guys me again.

 

Atm I'm receiving undefined index when I try to echo out a table.

 

Mine code;

 

<?php
include("config.php");

$sql=mysql_query("SELECT post FROM news");
$rij=mysql_fetch_array($sql);
$row=mysql_fetch_assoc($sql);

echo $row['number'];

echo $rij['number'];
echo $rij['post'];
echo  "<br>";


?>

 

Number table setting;

Column; number

Type; INT

Length/Values;255

Auto_Increment; (tried it both on yes and no)

 

Anyone have any idea or must I echo it out in a different way?

u have to select every field ur outputting

$sql=mysql_query("SELECT `post`,`number` FROM news");

  • Author

There was some bug in the wamp server.

 

After re-installing the wamp program and re-create the table and re-create the code it finnaly worked correctly.

 

Oh well thanks for the headups.

There was some bug in the wamp server.

 

After re-installing the wamp program and re-create the table and re-create the code it finnaly worked correctly.

 

Oh well thanks for the headups.

mmm from what i can see the only bug was in ur code lol but none the less glad u got it working

Create an account or sign in to comment

Account

Navigation

Search

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.