Someone help me fix this?

rbxlmadx

Member
Messages
32
Reaction score
1
Points
8
I am trying to create a user chart for my site, I am using Google chart, the url, and I have made a database to edit the url, in this bracket ((((( ))))) in the url, is the numbers I want to edit, using a number from my database. Here is the problem, I am trying to fetch the number from the database but I can't define it like this:

mysql_query("SELECT * FROM days WHERE one='1'");

Because The numbers update with every new users, so I tried this:

mysql_query("SELECT one FROM days");

But that does not work. And for more info, the urn of the Google chart is not in a PHP script: <?php ?> so IDK if I can put $one or whatever in to the url. I do not know what to do....


<center><img src='http://chart.googleapis.com/chart?c...0|1:|0|25|50|75|100|2:|||3:||Days|'></center>

<?php
$one = mysql_query("SELECT one FROM days");
$id1 = $_GET['one'];
$Aa = 0;
$Getone = mysql_query("SELECT * FROM days WHERE one=one + ".$Aa."");
$one = mysql_num_rows($Getone);
$Gettwo
$Getthree
$Getfour
$Getfive
$Getsix
$Getseven
$Geteight
$Getnine
$Getten
$Geteleven
$Gettwelve
$Getthirteen
$Getfourteen
$Getfifteen
$Getsixteen
$Getseventeen
$Geteighteen
$Getnineteen
$Gettwenty
?>
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi rbxlmadx,

I have moved this thread and your other thread to the Off Topic forum, as this question is unrelated to our hosting service. :)

Before continuing, I recommend that you look into using PDO for your MySQL connection, to protect yourself from SQL injection attacks. ;)

Thank you,
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Don't explain what you're doing; explain what you are trying to do. There is, essentially, nothing right with the code you've posted. Your WHERE clause is impossible; nothing can equal a modified version of itself (unless you are appending "", which is kind of a pointless thing to keep in a variable and append). I don't mean what you are trying to do with this code; I mean what you are trying to do with this page -- step by step, in detail.
 
Top