php问题。请看看你是否可以提供帮助 [英] php question. Pls take a look and see if you can help

查看:52
本文介绍了php问题。请看看你是否可以提供帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我已经在我的数据库中创建了一个新表(例如/''XM_newtable'')并在其中我

有一个字段(例如/''newfield'')


我在''newfield'下输入了100个值,我需要做的是

在我插入一些代码时随机显示这些值。


我的问题是我不知道要插入什么代码

我猜这将是一个类似于下面的代码。但是

直接通往这个领域的路径是什么?如何从这个字段中随机获得结果




<?php

print(" $ newfield";;




我想要的最后一件事是如果该字段没有任何

条目(所以如果我拿出我放入的100个值)那么我会想要让代码打印消息对不起但没有价值可用! ;

所有帮助总是受到赞赏。

谢谢

解决方案

newfield" ;);




我想要的最后一件事是,如果该字段没有任何

条目(所以如果我拿出我放入的100个值)那么我会想要让代码打印消息对不起但没有价值可用!

我们非常感谢所有帮助。

谢谢


我用一个随机数来做这样的事情。放入一个排序字段,

将一个1到100的随机数放入其中。解析记录并根据该数字排序




希望我在写我的之前用Google搜索。不,它帮助了我。


如果你赶时间,请看看这个。

http://scripts.franciscocharrua.com/...result-set.php


Hi All,

I''ve created a new table (eg/ ''XM_newtable'') on my database and in it I
have a single field (eg/ ''newfield'')

I have entered 100 values under the ''newfield'' and what I need to do is
display these values at random wherever I insert a bit of code.

My problem is that I don''t know what bit of code to insert
I guess that it will be a code similar to below. But what would the
direct path to this field be? And how can I make the result be random
from this field?

<?php
print("$newfield");



The final thing that I would like is that if the field doesn''t have any
entries (so if I take out the 100 values that I''ve put in) then I would
like to have the code print the message "sorry but no value available!"
All help is always appreciated.
Thanks

解决方案

newfield");



The final thing that I would like is that if the field doesn''t have any
entries (so if I take out the 100 values that I''ve put in) then I would
like to have the code print the message "sorry but no value available!"
All help is always appreciated.
Thanks


I use a random number to do things like this. Put in a sort field and
put a random number from 1 to 100 in it. Parse the records and sort
according to that number.


Wish I had googled before I wrote mine. Nah, it helped me.

If you are in a hurry however, take a look at this.

http://scripts.franciscocharrua.com/...result-set.php


这篇关于php问题。请看看你是否可以提供帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆