473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Empty tables are being created..?

i have a php code in which i create a table and insert the variable's data. when i echo the data. its shown correctly. but when i try that again the tables are empty,
for example,


i have the code at http://www.vtuhub.com if i type 3BK08EC043 in the form it fetches the data from results.vtu.ac.in site... and shows it and stores it in my database... but when i try the same 3BK08EC043 again... it shows the the data is "available in database"... but its not showing it.. that is... empty data is being inserted in the table...?? can anyone help me out..?
Aug 5 '10 #1
8 1401
code green
1,726 Expert 1GB
Not without any code to view
Aug 5 '10 #2
I removed the code
Aug 5 '10 #3
can u help me out.. whats the prob..?
Aug 5 '10 #4
hey dude give me ur email id.. i don't want any1 to use this code.. i'll remove it from here pls..:)
Aug 5 '10 #5
code green
1,726 Expert 1GB
i don't want any1 to use this code
It can't be so good if you need help here to make it work!
Besides, we only need to see the problem code not all of it.
If you don't know where the problem is, then I suggest putting some error trapping and test output to trace the problem
Aug 5 '10 #6
$em=mysql_query("INSERT INTO $value (marks) VALUES ($x)");

in this the field marks is being created.. but the data isn't being inserted... all i wanna knw is if there is any single quote in the string(the string contains the html) will that coz an error..?
Aug 5 '10 #7
code green
1,726 Expert 1GB
Wrap the value in quotes
Expand|Select|Wrap|Line Numbers
  1. $em=mysql_query("INSERT INTO $value (marks) VALUES ('$x')");
  2.  
Aug 5 '10 #8
Atli
5,058 Expert 4TB
all i wanna knw is if there is any single quote in the string(the string contains the html) will that coz an error..?
Yes. MySQL strings are wrapped in single-quotes (like in @code green's example). Putting a single-quote into a single-quote delimited string will, obviously, cause a parse error.

We use the mysql_real_escape_string function to avoid problems like this. It replaces all characters in a string that would cause a problem to a MySQL query with safe alternatives.
Aug 5 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Doug | last post by:
Hi all. Have a SQL server with about 10 small databases on it. One database in particular, the tables are somehow being recreated each night at 12:03 AM. The tables are also empty of data. There's...
3
by: NickName | last post by:
Here's the situation, developers inherit a web app from someone, backend SQL db has about 120 user tables and the db is also being used by other apps. Developers don't have a list of user tables...
0
by: Phil Galey | last post by:
I'm loading tables from an XML file into a dataset. However, if a table has no records, that table doesn't get saved into the XML file. This causes problems when you ReadXML into the dataset and...
1
by: narayana | last post by:
how to know about how many tables i created in that database.if the database is connected to many users. i want the query in this way that i want creater,number of tables,time,updates . the...
0
by: Nagachandra Sekhar Grandhi | last post by:
I have written a VB application which accesses an excel file from the network drive and import the data into the database. We need to run this job under a user previleges in an unattended...
3
seshu
by: seshu | last post by:
hi everybody the problem i have is i have created a doc file on form load and this is even get created well but i wrote a code to copy the file from that location to someothere location wheen i run...
4
by: jbrumbau | last post by:
Hello, I have been successfully using a database I've created for several months to populate an equipment list for a project we've been working on. However, the form has recently stopped working...
10
flexsingh
by: flexsingh | last post by:
Hello there, I have a form and when data is inputted it goes into the table and I can get it out pefectly fine, the problem I have is that if the promary key is empty it will not submit, but if any...
0
by: Swys | last post by:
Hi all, I'm using the MYSQL connector for C# and I have a problem with a temporary table. I create it with the CREATE TEMPORARY TABLE command after doing the DROP TABLE IF EXISTS and then try to...
1
by: visweswaran2830 | last post by:
How do database and tables get created when I am pressing create user wizard in asp.net?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.