Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8897229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:17:10+00:00 2026-06-15T00:17:10+00:00

Right now I am working with a mysql database table. I have created a

  • 0

Right now I am working with a mysql database table. I have created a form that will input the data. The four fields that data is being entered are Class Caption Class Name Class Description Credit Hours. I have set an auto increment id but every time I save a class I get an id that equals 0 and for the class caption I get a . period showing up infront. I am not sure why this issue is coming up every time I submit information into the database.

PHP

<h1>class</h1>

<?php
    include ('Resources/db_connect.php');
    $query="SELECT * FROM class";
    $result=mysql_query($query, $db_link);
if ($result){
    $num=mysql_num_rows($result);
    mysql_close();
?>

<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td><h3>id</h3></td>
<td><h3>class_caption</h3></td>
<td><h3>class_name</h3></td>
<td><h3>class_description</h3></td>
<td><h3>class_credit_hours</h3></td>
</tr>

<?php
$i=0;
while ($i < $num) {

$f1=mysql_result($result,$i,"id");
$f2=mysql_result($result,$i,"class_caption");
$f3=mysql_result($result,$i,"class_name");
$f4=mysql_result($result,$i,"class_description");
$f5=mysql_result($result,$i,"class_credit_hours");
?>

<tr>
<td><?php echo $f1; ?></td>    
<td><?php echo $f2; ?></td>    
<td><?php echo $f3; ?></td>    
<td><?php echo $f4; ?></td>    
<td><?php echo $f5; ?></td>    
</tr>

<?php
$i++;

}
}
else{
    echo "No Results Found";
    mysql_close($db_link);
}
?>

Insert Form

<form action="" method="post">
<table>
<tr>
    <td>Class Caption: <td><input type="text" name="class_caption" size="8"><br>
</tr>
<tr>
    <td>Class Name: <td><input type="text" name="class_name" size="30"><br>
</tr>
<tr>
    <td>Class Description: <td><textarea rows="5" name="class_description" cols="50"></textarea><br>
</tr>
<tr>
    <td>Credit Hours: <td><input type="text" name="class_credit_hours" size="1">
</tr>
<tr>
    <td><input type="submit" value="Submit">
</tr>
</table>
</form>

Table Design: LINK

QUERY

CREATE TABLE class
(
    id INT,
    class_caption VARCHAR(30),
    class_name VARCHAR(30),
    class_description VARCHAR(300),
    class_credit_hours INT,
    CONSTRAINT cc_pk PRIMARY KEY (id),
    CONSTRAINT cc_uq UNIQUE (class_caption)
);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:17:11+00:00Added an answer on June 15, 2026 at 12:17 am

    Where is the auto increment defined?
    Shouldn’t there be something like :

    CREATE TABLE class
    (
    id int(11) NOT NULL AUTO_INCREMENT,...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created some tests in my WPF application. Right now I am working
I'm working on a program that makes using MySQL databases simpler. Right now I
Right now I am working with a text file that happens to have all
I am working on an application for java right now that will be using
Right now I am working on one Real Estate Website, In that website I
Right now I'm working on a program that throws up a bunch of separate
Im working right now on a program that can divide, add, ect, but, im
It doesn't seem to be working right now. I get a java.lang.NullPointerException I have
I am new to database development and am currently working in MySQL. I have
I have a desktop app in Java that connects to a MySql database through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.