Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Actually I take it back. http://css-tricks.com/attribute-selectors You may be able to. Try this.
-
No. You can style all labels or use classes or ids.
-
You still need to start checking for errors. If you don't get in the habit of it (or write a wrapper for this) it will take you longer to debug future problems.
-
Why don't YOU tell US what the problem is? IE, why do you THINK there is a problem. Try checking for errors. Try running the query in phpmyadmin. What HAVE you done besides stare at it? :-P Oh and also once you get your error, you're going to want to read this page of the manual. http://dev.mysql.com/doc/refman/5.0/en/select.html
-
There is definitely something wrong with the query. I can see what it is right away. Figuring it out would expose what's wrong with your function. If you were checking for errors, it'd be a lot clearer. See the link in my signature on how to debug your SQL.
-
You're probably going to want to use an array, if I understand your goal.
-
I say you should go with what Psycho said, but if you want to keep trying to make this code work you have to explain what you mean by "doesn't work". What part doesn't work? What steps have you taken to debug it?
-
And where is $row['Nom_v']; defined? Do you see a pattern yet?
-
And where is $n defined? Before you respond, I suggest you read the links in my signature about how to get good help. Otherwise this is going to take 5 times longer than it needs to, and I just don't care to do that.
-
Probably because '$n' means the literal string '$n'. You probably want to use $n. But the code you've posted has nothing showing either of those.
-
You need to check for errors. See the link in my signature. Edit: Actually it sounds like you're not even connected to the database.
-
Accessing the value of a Multidimensional array
Jessica replied to sakilimran's topic in PHP Coding Help
Can you remove the useless [0]-[10]s? If so do that and it'll be a lot easier. Otherwise loop through $this->data['price_list'] and check it there. -
Seriously dude, I'm working with the code you gave us. You do NOT have to fetch a row before getting the number of rows. http://us2.php.net/mysql_num_rows I'm suspecting that is messing up your count, the fact that you're trying to do it after using the rows. We can't tell you why it's not showing what you expect because you refuse to do ANYTHING we suggest. I'm done.
-
As was suggested, try adding the other column names so you can see what the three rows are. I'm curious what it would look like if you changed it to this: <?php function photo_history_bypaths($courriel) { $table = "_files"; $courriel = trim($courriel); $sql =mysql_query("SELECT img_name FROM $table WHERE email = '$courriel'AND ok = '1' ORDER BY id DESC LIMIT 0 , 3") or die("&erreur=Échec de la requête !"); if ( mysql_num_rows($sql) > 0) { print "&erreur="."&nombre=".mysql_num_rows($sql)."&liste=".$flashstr; } } ?>
-
Looping through an array setting child arrays in position
Jessica replied to jkkenzie's topic in PHP Coding Help
So then where are you stuck? You already had someone write the above code for you in the other thread, now apply what you should have learned from that to this. Or restructure the array. I've done a lot of work like this, lately I had to write a report that had 8 levels of country, region, state, city, district, etc etc. It was easiest to do a multi-dimensional array that had many levels. (That report was not only deep in levels, but long (rows) and wide(columns) so we actually utilized some ajax loading and only loaded one level at a time, but the initial version that only had 3 levels would have looked something like this: IE: $locations = array( 'Country 1'=>array( 'text'=>'text', 'url'=>'url here', 'states'=>array( 'state 1'=>array( 'text'=>'text', 'url'=>'url here', 'cities'=>array( //etc etc etc ) ), 'state 2'=>array( 'text'=>'text', 'url'=>'url here', 'cities'=>array( //etc etc etc ) ) ) ), 'Country 2'=>array( 'text'=>'text', 'url'=>'url here', 'states'=>array(//etc etc etc) ) ); -
Looping through an array setting child arrays in position
Jessica replied to jkkenzie's topic in PHP Coding Help
I don't see anything that links the grandchild elements to their parent elements. You should make this a multi-dimensional array, or store the parent/foreign key in the array. -
Storing numbers in a database, separated by commas
Jessica replied to slyte33's topic in PHP Coding Help
By normalizing your data. Seriously. I'm not saying it for the fun of it, the problems you are running into stem from bad design. Fix it now, it'll be easier to fix it now than later. -
Storing numbers in a database, separated by commas
Jessica replied to slyte33's topic in PHP Coding Help
Google "normalization". You don't want to store the data as a delimited list. -
Well either make an effort to learn or hire someone.
- 12 replies
-
I'm going to add emoji to my passwords so I can ONLY login on my iPhone. That'll show me!
-
Trying to hide field title and suffix when empty
Jessica replied to jodancer's topic in PHP Coding Help
Without code we can't do much to help you -
Btw I said string - a string can contain multiple variables. If you need them separate, use an array. Or separate the logic into two functions.
-
Problem with retrieving results from MySQL query
Jessica replied to gettingherdone's topic in PHP Coding Help
Look in the manual. !! Is for or in a comparison. ! Is not. -
I'm sick, google it.